115 #ifndef PY_SSIZE_T_CLEAN
116 #define PY_SSIZE_T_CLEAN
120 #error Python headers needed to compile C extensions, please install development version of Python.
121 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
122 #error Cython requires Python 2.6+ or Python 3.3+.
124 #define CYTHON_ABI "0_29_36"
125 #define CYTHON_HEX_VERSION 0x001D24F0
126 #define CYTHON_FUTURE_DIVISION 1
129 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
131 #if !defined(WIN32) && !defined(MS_WINDOWS)
143 #define DL_IMPORT(t) t
146 #define DL_EXPORT(t) t
148 #define __PYX_COMMA ,
149 #ifndef HAVE_LONG_LONG
150 #if PY_VERSION_HEX >= 0x02070000
151 #define HAVE_LONG_LONG
155 #define PY_LONG_LONG LONG_LONG
158 #define Py_HUGE_VAL HUGE_VAL
161 #define CYTHON_COMPILING_IN_PYPY 1
162 #define CYTHON_COMPILING_IN_PYSTON 0
163 #define CYTHON_COMPILING_IN_CPYTHON 0
164 #define CYTHON_COMPILING_IN_NOGIL 0
165 #undef CYTHON_USE_TYPE_SLOTS
166 #define CYTHON_USE_TYPE_SLOTS 0
167 #undef CYTHON_USE_PYTYPE_LOOKUP
168 #define CYTHON_USE_PYTYPE_LOOKUP 0
169 #if PY_VERSION_HEX < 0x03050000
170 #undef CYTHON_USE_ASYNC_SLOTS
171 #define CYTHON_USE_ASYNC_SLOTS 0
172 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
173 #define CYTHON_USE_ASYNC_SLOTS 1
175 #undef CYTHON_USE_PYLIST_INTERNALS
176 #define CYTHON_USE_PYLIST_INTERNALS 0
177 #undef CYTHON_USE_UNICODE_INTERNALS
178 #define CYTHON_USE_UNICODE_INTERNALS 0
179 #undef CYTHON_USE_UNICODE_WRITER
180 #define CYTHON_USE_UNICODE_WRITER 0
181 #undef CYTHON_USE_PYLONG_INTERNALS
182 #define CYTHON_USE_PYLONG_INTERNALS 0
183 #undef CYTHON_AVOID_BORROWED_REFS
184 #define CYTHON_AVOID_BORROWED_REFS 1
185 #undef CYTHON_ASSUME_SAFE_MACROS
186 #define CYTHON_ASSUME_SAFE_MACROS 0
187 #undef CYTHON_UNPACK_METHODS
188 #define CYTHON_UNPACK_METHODS 0
189 #undef CYTHON_FAST_THREAD_STATE
190 #define CYTHON_FAST_THREAD_STATE 0
191 #undef CYTHON_FAST_PYCALL
192 #define CYTHON_FAST_PYCALL 0
193 #if PY_VERSION_HEX < 0x03090000
194 #undef CYTHON_PEP489_MULTI_PHASE_INIT
195 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
196 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
197 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
199 #undef CYTHON_USE_TP_FINALIZE
200 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
201 #undef CYTHON_USE_DICT_VERSIONS
202 #define CYTHON_USE_DICT_VERSIONS 0
203 #undef CYTHON_USE_EXC_INFO_STACK
204 #define CYTHON_USE_EXC_INFO_STACK 0
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
208 #elif defined(PYSTON_VERSION)
209 #define CYTHON_COMPILING_IN_PYPY 0
210 #define CYTHON_COMPILING_IN_PYSTON 1
211 #define CYTHON_COMPILING_IN_CPYTHON 0
212 #define CYTHON_COMPILING_IN_NOGIL 0
213 #ifndef CYTHON_USE_TYPE_SLOTS
214 #define CYTHON_USE_TYPE_SLOTS 1
216 #undef CYTHON_USE_PYTYPE_LOOKUP
217 #define CYTHON_USE_PYTYPE_LOOKUP 0
218 #undef CYTHON_USE_ASYNC_SLOTS
219 #define CYTHON_USE_ASYNC_SLOTS 0
220 #undef CYTHON_USE_PYLIST_INTERNALS
221 #define CYTHON_USE_PYLIST_INTERNALS 0
222 #ifndef CYTHON_USE_UNICODE_INTERNALS
223 #define CYTHON_USE_UNICODE_INTERNALS 1
225 #undef CYTHON_USE_UNICODE_WRITER
226 #define CYTHON_USE_UNICODE_WRITER 0
227 #undef CYTHON_USE_PYLONG_INTERNALS
228 #define CYTHON_USE_PYLONG_INTERNALS 0
229 #ifndef CYTHON_AVOID_BORROWED_REFS
230 #define CYTHON_AVOID_BORROWED_REFS 0
232 #ifndef CYTHON_ASSUME_SAFE_MACROS
233 #define CYTHON_ASSUME_SAFE_MACROS 1
235 #ifndef CYTHON_UNPACK_METHODS
236 #define CYTHON_UNPACK_METHODS 1
238 #undef CYTHON_FAST_THREAD_STATE
239 #define CYTHON_FAST_THREAD_STATE 0
240 #undef CYTHON_FAST_PYCALL
241 #define CYTHON_FAST_PYCALL 0
242 #undef CYTHON_PEP489_MULTI_PHASE_INIT
243 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
244 #undef CYTHON_USE_TP_FINALIZE
245 #define CYTHON_USE_TP_FINALIZE 0
246 #undef CYTHON_USE_DICT_VERSIONS
247 #define CYTHON_USE_DICT_VERSIONS 0
248 #undef CYTHON_USE_EXC_INFO_STACK
249 #define CYTHON_USE_EXC_INFO_STACK 0
250 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
251 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
253 #elif defined(PY_NOGIL)
254 #define CYTHON_COMPILING_IN_PYPY 0
255 #define CYTHON_COMPILING_IN_PYSTON 0
256 #define CYTHON_COMPILING_IN_CPYTHON 0
257 #define CYTHON_COMPILING_IN_NOGIL 1
258 #ifndef CYTHON_USE_TYPE_SLOTS
259 #define CYTHON_USE_TYPE_SLOTS 1
261 #undef CYTHON_USE_PYTYPE_LOOKUP
262 #define CYTHON_USE_PYTYPE_LOOKUP 0
263 #ifndef CYTHON_USE_ASYNC_SLOTS
264 #define CYTHON_USE_ASYNC_SLOTS 1
266 #undef CYTHON_USE_PYLIST_INTERNALS
267 #define CYTHON_USE_PYLIST_INTERNALS 0
268 #ifndef CYTHON_USE_UNICODE_INTERNALS
269 #define CYTHON_USE_UNICODE_INTERNALS 1
271 #undef CYTHON_USE_UNICODE_WRITER
272 #define CYTHON_USE_UNICODE_WRITER 0
273 #undef CYTHON_USE_PYLONG_INTERNALS
274 #define CYTHON_USE_PYLONG_INTERNALS 0
275 #ifndef CYTHON_AVOID_BORROWED_REFS
276 #define CYTHON_AVOID_BORROWED_REFS 0
278 #ifndef CYTHON_ASSUME_SAFE_MACROS
279 #define CYTHON_ASSUME_SAFE_MACROS 1
281 #ifndef CYTHON_UNPACK_METHODS
282 #define CYTHON_UNPACK_METHODS 1
284 #undef CYTHON_FAST_THREAD_STATE
285 #define CYTHON_FAST_THREAD_STATE 0
286 #undef CYTHON_FAST_PYCALL
287 #define CYTHON_FAST_PYCALL 0
288 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
289 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
291 #ifndef CYTHON_USE_TP_FINALIZE
292 #define CYTHON_USE_TP_FINALIZE 1
294 #undef CYTHON_USE_DICT_VERSIONS
295 #define CYTHON_USE_DICT_VERSIONS 0
296 #undef CYTHON_USE_EXC_INFO_STACK
297 #define CYTHON_USE_EXC_INFO_STACK 0
299 #define CYTHON_COMPILING_IN_PYPY 0
300 #define CYTHON_COMPILING_IN_PYSTON 0
301 #define CYTHON_COMPILING_IN_CPYTHON 1
302 #define CYTHON_COMPILING_IN_NOGIL 0
303 #ifndef CYTHON_USE_TYPE_SLOTS
304 #define CYTHON_USE_TYPE_SLOTS 1
306 #if PY_VERSION_HEX < 0x02070000
307 #undef CYTHON_USE_PYTYPE_LOOKUP
308 #define CYTHON_USE_PYTYPE_LOOKUP 0
309 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
310 #define CYTHON_USE_PYTYPE_LOOKUP 1
312 #if PY_MAJOR_VERSION < 3
313 #undef CYTHON_USE_ASYNC_SLOTS
314 #define CYTHON_USE_ASYNC_SLOTS 0
315 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
316 #define CYTHON_USE_ASYNC_SLOTS 1
318 #if PY_VERSION_HEX < 0x02070000
319 #undef CYTHON_USE_PYLONG_INTERNALS
320 #define CYTHON_USE_PYLONG_INTERNALS 0
321 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
322 #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
324 #ifndef CYTHON_USE_PYLIST_INTERNALS
325 #define CYTHON_USE_PYLIST_INTERNALS 1
327 #ifndef CYTHON_USE_UNICODE_INTERNALS
328 #define CYTHON_USE_UNICODE_INTERNALS 1
330 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
331 #undef CYTHON_USE_UNICODE_WRITER
332 #define CYTHON_USE_UNICODE_WRITER 0
333 #elif !defined(CYTHON_USE_UNICODE_WRITER)
334 #define CYTHON_USE_UNICODE_WRITER 1
336 #ifndef CYTHON_AVOID_BORROWED_REFS
337 #define CYTHON_AVOID_BORROWED_REFS 0
339 #ifndef CYTHON_ASSUME_SAFE_MACROS
340 #define CYTHON_ASSUME_SAFE_MACROS 1
342 #ifndef CYTHON_UNPACK_METHODS
343 #define CYTHON_UNPACK_METHODS 1
345 #if PY_VERSION_HEX >= 0x030B00A4
346 #undef CYTHON_FAST_THREAD_STATE
347 #define CYTHON_FAST_THREAD_STATE 0
348 #elif !defined(CYTHON_FAST_THREAD_STATE)
349 #define CYTHON_FAST_THREAD_STATE 1
351 #ifndef CYTHON_FAST_PYCALL
352 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
354 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
355 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
357 #ifndef CYTHON_USE_TP_FINALIZE
358 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
360 #ifndef CYTHON_USE_DICT_VERSIONS
361 #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
363 #if PY_VERSION_HEX >= 0x030B00A4
364 #undef CYTHON_USE_EXC_INFO_STACK
365 #define CYTHON_USE_EXC_INFO_STACK 0
366 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
367 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
369 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
370 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
373 #if !defined(CYTHON_FAST_PYCCALL)
374 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
376 #if CYTHON_USE_PYLONG_INTERNALS
377 #if PY_MAJOR_VERSION < 3
378 #include "longintrepr.h"
384 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
387 #ifndef __has_attribute
388 #define __has_attribute(x) 0
390 #ifndef __has_cpp_attribute
391 #define __has_cpp_attribute(x) 0
393 #ifndef CYTHON_RESTRICT
394 #if defined(__GNUC__)
395 #define CYTHON_RESTRICT __restrict__
396 #elif defined(_MSC_VER) && _MSC_VER >= 1400
397 #define CYTHON_RESTRICT __restrict
398 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
399 #define CYTHON_RESTRICT restrict
401 #define CYTHON_RESTRICT
404 #ifndef CYTHON_UNUSED
405 # if defined(__GNUC__)
406 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
407 # define CYTHON_UNUSED __attribute__ ((__unused__))
409 # define CYTHON_UNUSED
411 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
412 # define CYTHON_UNUSED __attribute__ ((__unused__))
414 # define CYTHON_UNUSED
417 #ifndef CYTHON_MAYBE_UNUSED_VAR
418 # if defined(__cplusplus)
419 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
421 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
424 #ifndef CYTHON_NCP_UNUSED
425 # if CYTHON_COMPILING_IN_CPYTHON
426 # define CYTHON_NCP_UNUSED
428 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
431 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
433 #ifndef _MSC_STDINT_H_
435 typedef unsigned char uint8_t;
436 typedef unsigned int uint32_t;
438 typedef unsigned __int8 uint8_t;
439 typedef unsigned __int32 uint32_t;
445 #ifndef CYTHON_FALLTHROUGH
446 #if defined(__cplusplus) && __cplusplus >= 201103L
447 #if __has_cpp_attribute(fallthrough)
448 #define CYTHON_FALLTHROUGH [[fallthrough]]
449 #elif __has_cpp_attribute(clang::fallthrough)
450 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
451 #elif __has_cpp_attribute(gnu::fallthrough)
452 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
455 #ifndef CYTHON_FALLTHROUGH
456 #if __has_attribute(fallthrough)
457 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
459 #define CYTHON_FALLTHROUGH
462 #if defined(__clang__ ) && defined(__apple_build_version__)
463 #if __apple_build_version__ < 7000000
464 #undef CYTHON_FALLTHROUGH
465 #define CYTHON_FALLTHROUGH
471 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
473 #ifndef CYTHON_INLINE
474 #if defined(__clang__)
475 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
477 #define CYTHON_INLINE inline
481 void __Pyx_call_destructor(T& x) {
485 class __Pyx_FakeReference {
487 __Pyx_FakeReference() : ptr(NULL) { }
488 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
489 T *operator->() {
return ptr; }
490 T *operator&() {
return ptr; }
491 operator T&() {
return *ptr; }
492 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
493 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
498 #define __PYX_BUILD_PY_SSIZE_T "n"
499 #define CYTHON_FORMAT_SSIZE_T "z"
500 #if PY_MAJOR_VERSION < 3
501 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
502 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
503 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
504 #define __Pyx_DefaultClassType PyClass_Type
506 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
507 #define __Pyx_DefaultClassType PyType_Type
508 #if PY_VERSION_HEX >= 0x030B00A1
509 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
510 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
511 PyObject *fv, PyObject *cell, PyObject* fn,
512 PyObject *name,
int fline, PyObject *lnos) {
513 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
514 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
515 const char *fn_cstr=NULL;
516 const char *name_cstr=NULL;
517 PyCodeObject* co=NULL;
518 PyObject *type, *value, *traceback;
519 PyErr_Fetch(&type, &value, &traceback);
520 if (!(kwds=PyDict_New()))
goto end;
521 if (!(argcount=PyLong_FromLong(a)))
goto end;
522 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
523 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
524 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
525 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
526 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
527 if (!(nlocals=PyLong_FromLong(l)))
goto end;
528 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
529 if (!(stacksize=PyLong_FromLong(s)))
goto end;
530 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
531 if (!(flags=PyLong_FromLong(f)))
goto end;
532 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
533 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
534 if (PyDict_SetItemString(kwds,
"co_consts", c) != 0)
goto end;
535 if (PyDict_SetItemString(kwds,
"co_names", n) != 0)
goto end;
536 if (PyDict_SetItemString(kwds,
"co_varnames", v) != 0)
goto end;
537 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
538 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
539 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
540 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
541 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
542 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
543 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
544 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
545 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
546 Py_XDECREF((PyObject*)co);
547 co = (PyCodeObject*)call_result;
551 Py_XDECREF((PyObject*)co);
556 Py_XDECREF(argcount);
557 Py_XDECREF(posonlyargcount);
558 Py_XDECREF(kwonlyargcount);
560 Py_XDECREF(stacksize);
562 Py_XDECREF(call_result);
565 PyErr_Restore(type, value, traceback);
570 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
571 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
573 #define __Pyx_DefaultClassType PyType_Type
575 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
576 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
578 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
580 #ifndef Py_TPFLAGS_CHECKTYPES
581 #define Py_TPFLAGS_CHECKTYPES 0
583 #ifndef Py_TPFLAGS_HAVE_INDEX
584 #define Py_TPFLAGS_HAVE_INDEX 0
586 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
587 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
589 #ifndef Py_TPFLAGS_HAVE_FINALIZE
590 #define Py_TPFLAGS_HAVE_FINALIZE 0
592 #ifndef METH_STACKLESS
593 #define METH_STACKLESS 0
595 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
596 #ifndef METH_FASTCALL
597 #define METH_FASTCALL 0x80
599 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
600 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
601 Py_ssize_t nargs, PyObject *kwnames);
603 #define __Pyx_PyCFunctionFast _PyCFunctionFast
604 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
606 #if CYTHON_FAST_PYCCALL
607 #define __Pyx_PyFastCFunction_Check(func)\
608 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
610 #define __Pyx_PyFastCFunction_Check(func) 0
612 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
613 #define PyObject_Malloc(s) PyMem_Malloc(s)
614 #define PyObject_Free(p) PyMem_Free(p)
615 #define PyObject_Realloc(p) PyMem_Realloc(p)
617 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
618 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
619 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
620 #define PyMem_RawFree(p) PyMem_Free(p)
622 #if CYTHON_COMPILING_IN_PYSTON
623 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
624 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
626 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
627 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
629 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
630 #define __Pyx_PyThreadState_Current PyThreadState_GET()
631 #elif PY_VERSION_HEX >= 0x03060000
632 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
633 #elif PY_VERSION_HEX >= 0x03000000
634 #define __Pyx_PyThreadState_Current PyThreadState_GET()
636 #define __Pyx_PyThreadState_Current _PyThreadState_Current
638 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
639 #include "pythread.h"
640 #define Py_tss_NEEDS_INIT 0
641 typedef int Py_tss_t;
642 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
643 *key = PyThread_create_key();
646 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
647 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
648 *key = Py_tss_NEEDS_INIT;
651 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
654 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
655 return *key != Py_tss_NEEDS_INIT;
657 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
658 PyThread_delete_key(*key);
659 *key = Py_tss_NEEDS_INIT;
661 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
662 return PyThread_set_key_value(*key, value);
664 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
665 return PyThread_get_key_value(*key);
668 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
669 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
671 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
673 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
674 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
675 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
677 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
678 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
680 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
681 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
683 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
685 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
686 #define CYTHON_PEP393_ENABLED 1
687 #if PY_VERSION_HEX >= 0x030C0000
688 #define __Pyx_PyUnicode_READY(op) (0)
690 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
691 0 : _PyUnicode_Ready((PyObject *)(op)))
693 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
694 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
695 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
696 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
697 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
698 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
699 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
700 #if PY_VERSION_HEX >= 0x030C0000
701 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
703 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
704 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
706 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
710 #define CYTHON_PEP393_ENABLED 0
711 #define PyUnicode_1BYTE_KIND 1
712 #define PyUnicode_2BYTE_KIND 2
713 #define PyUnicode_4BYTE_KIND 4
714 #define __Pyx_PyUnicode_READY(op) (0)
715 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
716 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
717 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
718 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
719 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
720 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
721 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
722 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
724 #if CYTHON_COMPILING_IN_PYPY
725 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
726 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
728 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
729 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
730 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
732 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
733 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
735 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
736 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
738 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
739 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
741 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
742 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
743 #if PY_MAJOR_VERSION >= 3
744 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
746 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
748 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
749 #define PyObject_ASCII(o) PyObject_Repr(o)
751 #if PY_MAJOR_VERSION >= 3
752 #define PyBaseString_Type PyUnicode_Type
753 #define PyStringObject PyUnicodeObject
754 #define PyString_Type PyUnicode_Type
755 #define PyString_Check PyUnicode_Check
756 #define PyString_CheckExact PyUnicode_CheckExact
757 #ifndef PyObject_Unicode
758 #define PyObject_Unicode PyObject_Str
761 #if PY_MAJOR_VERSION >= 3
762 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
763 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
765 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
766 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
768 #ifndef PySet_CheckExact
769 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
771 #if PY_VERSION_HEX >= 0x030900A4
772 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
773 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
775 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
776 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
778 #if CYTHON_ASSUME_SAFE_MACROS
779 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
781 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
783 #if PY_MAJOR_VERSION >= 3
784 #define PyIntObject PyLongObject
785 #define PyInt_Type PyLong_Type
786 #define PyInt_Check(op) PyLong_Check(op)
787 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
788 #define PyInt_FromString PyLong_FromString
789 #define PyInt_FromUnicode PyLong_FromUnicode
790 #define PyInt_FromLong PyLong_FromLong
791 #define PyInt_FromSize_t PyLong_FromSize_t
792 #define PyInt_FromSsize_t PyLong_FromSsize_t
793 #define PyInt_AsLong PyLong_AsLong
794 #define PyInt_AS_LONG PyLong_AS_LONG
795 #define PyInt_AsSsize_t PyLong_AsSsize_t
796 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
797 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
798 #define PyNumber_Int PyNumber_Long
800 #if PY_MAJOR_VERSION >= 3
801 #define PyBoolObject PyLongObject
803 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
804 #ifndef PyUnicode_InternFromString
805 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
808 #if PY_VERSION_HEX < 0x030200A4
809 typedef long Py_hash_t;
810 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
811 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
813 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
814 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
816 #if PY_MAJOR_VERSION >= 3
817 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
819 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
821 #if CYTHON_USE_ASYNC_SLOTS
822 #if PY_VERSION_HEX >= 0x030500B1
823 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
824 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
826 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
829 #define __Pyx_PyType_AsAsync(obj) NULL
831 #ifndef __Pyx_PyAsyncMethodsStruct
836 } __Pyx_PyAsyncMethodsStruct;
839 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
840 #if !defined(_USE_MATH_DEFINES)
841 #define _USE_MATH_DEFINES
846 #define __PYX_NAN() ((float) NAN)
848 static CYTHON_INLINE
float __PYX_NAN() {
850 memset(&value, 0xFF,
sizeof(value));
854 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
855 #define __Pyx_truncl trunc
857 #define __Pyx_truncl truncl
860 #define __PYX_MARK_ERR_POS(f_index, lineno) \
861 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
862 #define __PYX_ERR(f_index, lineno, Ln_error) \
863 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
865 #ifndef __PYX_EXTERN_C
867 #define __PYX_EXTERN_C extern "C"
869 #define __PYX_EXTERN_C extern
873 #define __PYX_HAVE__imate___c_linear_operator__py_c_affine_matrix_function
874 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_affine_matrix_function
886 #include "pythread.h"
895 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
896 #define CYTHON_WITHOUT_ASSERTIONS
899 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
900 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
902 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
903 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
904 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
905 #define __PYX_DEFAULT_STRING_ENCODING ""
906 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
907 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
908 #define __Pyx_uchar_cast(c) ((unsigned char)c)
909 #define __Pyx_long_cast(x) ((long)x)
910 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
911 (sizeof(type) < sizeof(Py_ssize_t)) ||\
912 (sizeof(type) > sizeof(Py_ssize_t) &&\
913 likely(v < (type)PY_SSIZE_T_MAX ||\
914 v == (type)PY_SSIZE_T_MAX) &&\
915 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
916 v == (type)PY_SSIZE_T_MIN))) ||\
917 (sizeof(type) == sizeof(Py_ssize_t) &&\
918 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
919 v == (type)PY_SSIZE_T_MAX))) )
920 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
921 return (
size_t) i < (size_t) limit;
923 #if defined (__cplusplus) && __cplusplus >= 201103L
925 #define __Pyx_sst_abs(value) std::abs(value)
926 #elif SIZEOF_INT >= SIZEOF_SIZE_T
927 #define __Pyx_sst_abs(value) abs(value)
928 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
929 #define __Pyx_sst_abs(value) labs(value)
930 #elif defined (_MSC_VER)
931 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
932 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
933 #define __Pyx_sst_abs(value) llabs(value)
934 #elif defined (__GNUC__)
935 #define __Pyx_sst_abs(value) __builtin_llabs(value)
937 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
939 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
940 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
941 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
942 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
943 #define __Pyx_PyBytes_FromString PyBytes_FromString
944 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
945 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
946 #if PY_MAJOR_VERSION < 3
947 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
948 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
950 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
951 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
953 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
954 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
955 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
956 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
957 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
958 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
959 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
960 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
961 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
962 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
963 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
964 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
965 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
966 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
967 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
968 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
969 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
970 const Py_UNICODE *u_end = u;
972 return (
size_t)(u_end - u - 1);
974 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
975 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
976 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
977 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
978 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
979 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
980 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
981 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
982 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
983 #define __Pyx_PySequence_Tuple(obj)\
984 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
985 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
986 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
987 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
988 #if CYTHON_ASSUME_SAFE_MACROS
989 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
991 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
993 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
994 #if PY_MAJOR_VERSION >= 3
995 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
997 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
999 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1000 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1001 static int __Pyx_sys_getdefaultencoding_not_ascii;
1002 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1004 PyObject* default_encoding = NULL;
1005 PyObject* ascii_chars_u = NULL;
1006 PyObject* ascii_chars_b = NULL;
1007 const char* default_encoding_c;
1008 sys = PyImport_ImportModule(
"sys");
1010 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
1012 if (!default_encoding)
goto bad;
1013 default_encoding_c = PyBytes_AsString(default_encoding);
1014 if (!default_encoding_c)
goto bad;
1015 if (strcmp(default_encoding_c,
"ascii") == 0) {
1016 __Pyx_sys_getdefaultencoding_not_ascii = 0;
1018 char ascii_chars[128];
1020 for (c = 0; c < 128; c++) {
1023 __Pyx_sys_getdefaultencoding_not_ascii = 1;
1024 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1025 if (!ascii_chars_u)
goto bad;
1026 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1027 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1030 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1031 default_encoding_c);
1034 Py_DECREF(ascii_chars_u);
1035 Py_DECREF(ascii_chars_b);
1037 Py_DECREF(default_encoding);
1040 Py_XDECREF(default_encoding);
1041 Py_XDECREF(ascii_chars_u);
1042 Py_XDECREF(ascii_chars_b);
1046 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1047 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1049 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1050 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1051 static char* __PYX_DEFAULT_STRING_ENCODING;
1052 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1054 PyObject* default_encoding = NULL;
1055 char* default_encoding_c;
1056 sys = PyImport_ImportModule(
"sys");
1058 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
1060 if (!default_encoding)
goto bad;
1061 default_encoding_c = PyBytes_AsString(default_encoding);
1062 if (!default_encoding_c)
goto bad;
1063 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
1064 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
1065 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1066 Py_DECREF(default_encoding);
1069 Py_XDECREF(default_encoding);
1077 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1078 #define likely(x) __builtin_expect(!!(x), 1)
1079 #define unlikely(x) __builtin_expect(!!(x), 0)
1081 #define likely(x) (x)
1082 #define unlikely(x) (x)
1084 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1086 static PyObject *__pyx_m = NULL;
1087 static PyObject *__pyx_d;
1088 static PyObject *__pyx_b;
1089 static PyObject *__pyx_cython_runtime = NULL;
1090 static PyObject *__pyx_empty_tuple;
1091 static PyObject *__pyx_empty_bytes;
1092 static PyObject *__pyx_empty_unicode;
1093 static int __pyx_lineno;
1094 static int __pyx_clineno = 0;
1095 static const char * __pyx_cfilenm= __FILE__;
1096 static const char *__pyx_filename;
1099 static const char *__pyx_f[] = {
1100 "imate/_c_linear_operator/py_c_affine_matrix_function.pyx",
1104 struct __pyx_memoryview_obj;
1106 struct __pyx_memoryview_obj *memview;
1108 Py_ssize_t shape[8];
1109 Py_ssize_t strides[8];
1110 Py_ssize_t suboffsets[8];
1111 } __Pyx_memviewslice;
1112 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1115 #include <pythread.h>
1116 #ifndef CYTHON_ATOMICS
1117 #define CYTHON_ATOMICS 1
1119 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1120 #define __pyx_atomic_int_type int
1121 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1122 (__GNUC_MINOR__ > 1 ||\
1123 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1124 #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1125 #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1126 #ifdef __PYX_DEBUG_ATOMICS
1127 #warning "Using GNU atomics"
1129 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1131 #undef __pyx_atomic_int_type
1132 #define __pyx_atomic_int_type long
1133 #pragma intrinsic (_InterlockedExchangeAdd)
1134 #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1135 #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1136 #ifdef __PYX_DEBUG_ATOMICS
1137 #pragma message ("Using MSVC atomics")
1140 #undef CYTHON_ATOMICS
1141 #define CYTHON_ATOMICS 0
1142 #ifdef __PYX_DEBUG_ATOMICS
1143 #warning "Not using atomics"
1146 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1148 #define __pyx_add_acquisition_count(memview)\
1149 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1150 #define __pyx_sub_acquisition_count(memview)\
1151 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1153 #define __pyx_add_acquisition_count(memview)\
1154 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1155 #define __pyx_sub_acquisition_count(memview)\
1156 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1160 #ifndef __PYX_FORCE_INIT_THREADS
1161 #define __PYX_FORCE_INIT_THREADS 0
1165 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1166 #define __Pyx_PyGILState_Release PyGILState_Release
1167 #define __Pyx_FastGIL_Remember()
1168 #define __Pyx_FastGIL_Forget()
1169 #define __Pyx_FastGilFuncInit()
1172 #define IS_UNSIGNED(type) (((type) -1) > 0)
1173 struct __Pyx_StructField_;
1174 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1177 struct __Pyx_StructField_* fields;
1179 size_t arraysize[8];
1185 typedef struct __Pyx_StructField_ {
1186 __Pyx_TypeInfo* type;
1189 } __Pyx_StructField;
1191 __Pyx_StructField* field;
1192 size_t parent_offset;
1193 } __Pyx_BufFmt_StackElem;
1195 __Pyx_StructField root;
1196 __Pyx_BufFmt_StackElem* head;
1198 size_t new_count, enc_count;
1199 size_t struct_alignment;
1204 char is_valid_array;
1205 } __Pyx_BufFmt_Context;
1215 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1224 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1227 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1228 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1229 struct __pyx_array_obj;
1230 struct __pyx_MemviewEnum_obj;
1231 struct __pyx_memoryview_obj;
1232 struct __pyx_memoryviewslice_obj;
1241 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1250 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1259 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1268 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(
double const ,
double const );
1277 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1279 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1283 char *data_type_name;
1284 char *long_index_type_name;
1285 __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1286 PyObject *parameters;
1297 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1298 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1301 PyObject *A_indices_copy;
1302 PyObject *A_index_pointer_copy;
1303 PyObject *B_indices_copy;
1304 PyObject *B_index_pointer_copy;
1315 struct __pyx_array_obj {
1317 struct __pyx_vtabstruct_array *__pyx_vtab;
1323 Py_ssize_t *_strides;
1324 Py_ssize_t itemsize;
1327 void (*callback_free_data)(
void *);
1329 int dtype_is_object;
1340 struct __pyx_MemviewEnum_obj {
1353 struct __pyx_memoryview_obj {
1355 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1358 PyObject *_array_interface;
1359 PyThread_type_lock lock;
1360 __pyx_atomic_int acquisition_count[2];
1361 __pyx_atomic_int *acquisition_count_aligned_p;
1364 int dtype_is_object;
1365 __Pyx_TypeInfo *typeinfo;
1376 struct __pyx_memoryviewslice_obj {
1377 struct __pyx_memoryview_obj __pyx_base;
1378 __Pyx_memviewslice from_slice;
1379 PyObject *from_object;
1380 PyObject *(*to_object_func)(
char *);
1381 int (*to_dtype_func)(
char *, PyObject *);
1394 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1395 LongIndexType (*get_num_rows)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1396 LongIndexType (*get_num_columns)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1397 cLinearOperator<float> *(*get_linear_operator_float)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1398 cLinearOperator<double> *(*get_linear_operator_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1399 cLinearOperator<long double> *(*get_linear_operator_long_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1400 void (*dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1401 void (*transpose_dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1403 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1414 struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1415 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1417 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1428 struct __pyx_vtabstruct_array {
1429 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1431 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1442 struct __pyx_vtabstruct_memoryview {
1443 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1444 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1445 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1446 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1447 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1448 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1449 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1451 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1462 struct __pyx_vtabstruct__memoryviewslice {
1463 struct __pyx_vtabstruct_memoryview __pyx_base;
1465 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1469 #ifndef CYTHON_REFNANNY
1470 #define CYTHON_REFNANNY 0
1474 void (*INCREF)(
void*, PyObject*, int);
1475 void (*DECREF)(
void*, PyObject*, int);
1476 void (*GOTREF)(
void*, PyObject*, int);
1477 void (*GIVEREF)(
void*, PyObject*, int);
1478 void* (*SetupContext)(
const char*, int,
const char*);
1479 void (*FinishContext)(
void**);
1480 } __Pyx_RefNannyAPIStruct;
1481 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1482 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1483 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1485 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1487 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1488 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1489 PyGILState_Release(__pyx_gilstate_save);\
1491 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1494 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1495 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1497 #define __Pyx_RefNannyFinishContext()\
1498 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1499 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1500 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1501 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1502 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1503 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1504 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1505 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1506 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1508 #define __Pyx_RefNannyDeclarations
1509 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1510 #define __Pyx_RefNannyFinishContext()
1511 #define __Pyx_INCREF(r) Py_INCREF(r)
1512 #define __Pyx_DECREF(r) Py_DECREF(r)
1513 #define __Pyx_GOTREF(r)
1514 #define __Pyx_GIVEREF(r)
1515 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1516 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1517 #define __Pyx_XGOTREF(r)
1518 #define __Pyx_XGIVEREF(r)
1520 #define __Pyx_XDECREF_SET(r, v) do {\
1521 PyObject *tmp = (PyObject *) r;\
1522 r = v; __Pyx_XDECREF(tmp);\
1524 #define __Pyx_DECREF_SET(r, v) do {\
1525 PyObject *tmp = (PyObject *) r;\
1526 r = v; __Pyx_DECREF(tmp);\
1528 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1529 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1532 #if CYTHON_USE_TYPE_SLOTS
1533 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1535 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1539 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1542 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1545 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1546 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1547 const char* function_name);
1550 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1551 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1554 #if CYTHON_FAST_THREAD_STATE
1555 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1556 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1557 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1559 #define __Pyx_PyThreadState_declare
1560 #define __Pyx_PyThreadState_assign
1561 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1565 #if CYTHON_FAST_THREAD_STATE
1566 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1567 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1568 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1569 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1570 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1571 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1572 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1573 #if CYTHON_COMPILING_IN_CPYTHON
1574 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1576 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1579 #define __Pyx_PyErr_Clear() PyErr_Clear()
1580 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1581 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1582 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1583 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1584 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1585 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1586 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1590 #ifndef CYTHON_PROFILE
1591 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1592 #define CYTHON_PROFILE 0
1594 #define CYTHON_PROFILE 1
1597 #ifndef CYTHON_TRACE_NOGIL
1598 #define CYTHON_TRACE_NOGIL 0
1600 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1601 #define CYTHON_TRACE 1
1604 #ifndef CYTHON_TRACE
1605 #define CYTHON_TRACE 0
1608 #undef CYTHON_PROFILE_REUSE_FRAME
1610 #ifndef CYTHON_PROFILE_REUSE_FRAME
1611 #define CYTHON_PROFILE_REUSE_FRAME 0
1613 #if CYTHON_PROFILE || CYTHON_TRACE
1614 #include "compile.h"
1615 #include "frameobject.h"
1616 #include "traceback.h"
1617 #if PY_VERSION_HEX >= 0x030b00a6
1618 #ifndef Py_BUILD_CORE
1619 #define Py_BUILD_CORE 1
1621 #include "internal/pycore_frame.h"
1623 #if CYTHON_PROFILE_REUSE_FRAME
1624 #define CYTHON_FRAME_MODIFIER static
1625 #define CYTHON_FRAME_DEL(frame)
1627 #define CYTHON_FRAME_MODIFIER
1628 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1630 #define __Pyx_TraceDeclarations\
1631 static PyCodeObject *__pyx_frame_code = NULL;\
1632 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1633 int __Pyx_use_tracing = 0;
1634 #define __Pyx_TraceFrameInit(codeobj)\
1635 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1636 #if PY_VERSION_HEX >= 0x030b00a2
1637 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1638 (unlikely((tstate)->cframe->use_tracing) &&\
1639 (!(check_tracing) || !(tstate)->tracing) &&\
1640 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1641 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1642 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1643 #elif PY_VERSION_HEX >= 0x030a00b1
1644 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1645 (unlikely((tstate)->cframe->use_tracing) &&\
1646 (!(check_tracing) || !(tstate)->tracing) &&\
1647 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1648 #define __Pyx_EnterTracing(tstate)\
1649 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1650 #define __Pyx_LeaveTracing(tstate)\
1653 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1654 || tstate->c_profilefunc != NULL);\
1657 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1658 (unlikely((tstate)->use_tracing) &&\
1659 (!(check_tracing) || !(tstate)->tracing) &&\
1660 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1661 #define __Pyx_EnterTracing(tstate)\
1662 do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1663 #define __Pyx_LeaveTracing(tstate)\
1666 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1667 || tstate->c_profilefunc != NULL);\
1671 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1673 if (CYTHON_TRACE_NOGIL) {\
1674 PyThreadState *tstate;\
1675 PyGILState_STATE state = PyGILState_Ensure();\
1676 tstate = __Pyx_PyThreadState_Current;\
1677 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1678 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1680 PyGILState_Release(state);\
1681 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1684 PyThreadState* tstate = PyThreadState_GET();\
1685 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1686 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1687 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1691 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1692 { PyThreadState* tstate = PyThreadState_GET();\
1693 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1694 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1695 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1699 #define __Pyx_TraceException()\
1700 if (likely(!__Pyx_use_tracing)); else {\
1701 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1702 if (__Pyx_IsTracing(tstate, 0, 1)) {\
1703 __Pyx_EnterTracing(tstate);\
1704 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1706 if (CYTHON_TRACE && tstate->c_tracefunc)\
1707 tstate->c_tracefunc(\
1708 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1709 tstate->c_profilefunc(\
1710 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1711 Py_DECREF(exc_info);\
1713 __Pyx_LeaveTracing(tstate);\
1716 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1717 PyObject *type, *value, *traceback;
1718 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1719 __Pyx_EnterTracing(tstate);
1720 if (CYTHON_TRACE && tstate->c_tracefunc)
1721 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1722 if (tstate->c_profilefunc)
1723 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1724 CYTHON_FRAME_DEL(frame);
1725 __Pyx_LeaveTracing(tstate);
1726 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1729 #define __Pyx_TraceReturn(result, nogil)\
1730 if (likely(!__Pyx_use_tracing)); else {\
1732 if (CYTHON_TRACE_NOGIL) {\
1733 PyThreadState *tstate;\
1734 PyGILState_STATE state = PyGILState_Ensure();\
1735 tstate = __Pyx_PyThreadState_Current;\
1736 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1737 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1739 PyGILState_Release(state);\
1742 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1743 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1744 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1749 #define __Pyx_TraceReturn(result, nogil)\
1750 if (likely(!__Pyx_use_tracing)); else {\
1751 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1752 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1753 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1757 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1758 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1760 #define __Pyx_TraceDeclarations
1761 #define __Pyx_TraceFrameInit(codeobj)
1762 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1763 #define __Pyx_TraceException()
1764 #define __Pyx_TraceReturn(result, nogil)
1767 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1769 PyObject *type, *value, *traceback;
1770 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1771 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1772 __Pyx_EnterTracing(tstate);
1773 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1774 __Pyx_LeaveTracing(tstate);
1776 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1780 Py_XDECREF(traceback);
1785 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1786 if (likely(!__Pyx_use_tracing)); else {\
1788 if (CYTHON_TRACE_NOGIL) {\
1790 PyThreadState *tstate;\
1791 PyGILState_STATE state = PyGILState_Ensure();\
1792 tstate = __Pyx_PyThreadState_Current;\
1793 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1794 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1796 PyGILState_Release(state);\
1797 if (unlikely(ret)) goto_error;\
1800 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1801 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1802 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1803 if (unlikely(ret)) goto_error;\
1808 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1809 if (likely(!__Pyx_use_tracing)); else {\
1810 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1811 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1812 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1813 if (unlikely(ret)) goto_error;\
1818 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1822 #if CYTHON_COMPILING_IN_CPYTHON
1823 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1825 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1829 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1832 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
1838 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1841 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1842 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1843 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1844 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1845 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1846 (cache_var) = (value);
1847 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1848 static PY_UINT64_T __pyx_dict_version = 0;\
1849 static PyObject *__pyx_dict_cached_value = NULL;\
1850 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1851 (VAR) = __pyx_dict_cached_value;\
1853 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1854 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1857 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1858 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1859 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1861 #define __PYX_GET_DICT_VERSION(dict) (0)
1862 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1863 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1867 #if CYTHON_USE_DICT_VERSIONS
1868 #define __Pyx_GetModuleGlobalName(var, name) do {\
1869 static PY_UINT64_T __pyx_dict_version = 0;\
1870 static PyObject *__pyx_dict_cached_value = NULL;\
1871 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1872 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1873 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1875 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1876 PY_UINT64_T __pyx_dict_version;\
1877 PyObject *__pyx_dict_cached_value;\
1878 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1880 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1882 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1883 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1884 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1888 #if CYTHON_FAST_PYCCALL
1889 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1891 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1895 #if CYTHON_FAST_PYCALL
1896 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1897 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1898 #if 1 || PY_VERSION_HEX < 0x030600B1
1899 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1901 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1903 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1904 (sizeof(char [1 - 2*!(cond)]) - 1)
1905 #ifndef Py_MEMBER_SIZE
1906 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1908 #if CYTHON_FAST_PYCALL
1909 static size_t __pyx_pyframe_localsplus_offset = 0;
1910 #include "frameobject.h"
1911 #if PY_VERSION_HEX >= 0x030b00a6
1912 #ifndef Py_BUILD_CORE
1913 #define Py_BUILD_CORE 1
1915 #include "internal/pycore_frame.h"
1917 #define __Pxy_PyFrame_Initialize_Offsets()\
1918 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1919 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1920 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1921 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1926 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1929 #if CYTHON_COMPILING_IN_CPYTHON
1930 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1934 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1937 #if CYTHON_COMPILING_IN_CPYTHON
1938 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1940 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1944 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1945 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1946 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1947 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1948 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1949 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1950 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1951 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1952 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1953 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1954 int wraparound,
int boundscheck);
1955 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1956 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1957 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1958 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1959 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1960 int wraparound,
int boundscheck);
1961 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1962 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1963 int is_list,
int wraparound,
int boundscheck);
1966 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1967 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1968 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1969 (likely(PyDict_CheckExact(obj)) ?\
1970 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1972 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1973 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1977 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1978 #define __Pyx_MEMVIEW_DIRECT 1
1979 #define __Pyx_MEMVIEW_PTR 2
1980 #define __Pyx_MEMVIEW_FULL 4
1981 #define __Pyx_MEMVIEW_CONTIG 8
1982 #define __Pyx_MEMVIEW_STRIDED 16
1983 #define __Pyx_MEMVIEW_FOLLOW 32
1984 #define __Pyx_IS_C_CONTIG 1
1985 #define __Pyx_IS_F_CONTIG 2
1986 static int __Pyx_init_memviewslice(
1987 struct __pyx_memoryview_obj *memview,
1989 __Pyx_memviewslice *memviewslice,
1990 int memview_is_new_reference);
1991 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1992 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1993 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1994 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1995 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1996 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1997 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1998 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1999 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2000 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2003 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2004 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2005 __Pyx__ArgTypeTest(obj, type, name, exact))
2006 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2009 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2012 #if PY_MAJOR_VERSION >= 3
2013 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2015 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2019 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2020 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2022 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2024 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
2025 int lineno,
const char *filename,
2026 int full_traceback,
int nogil);
2028 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2030 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2033 #if CYTHON_USE_TYPE_SLOTS
2034 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2036 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2040 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
2042 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2044 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
2046 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2048 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
2050 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2054 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2055 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2056 const char* encoding,
const char* errors,
2057 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
2060 #if CYTHON_FAST_THREAD_STATE
2061 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2062 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2064 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2068 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2071 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2074 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2077 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2080 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2083 #if CYTHON_USE_EXC_INFO_STACK
2084 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2088 #if CYTHON_FAST_THREAD_STATE
2089 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2090 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2091 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2092 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2094 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2095 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2099 #if CYTHON_FAST_THREAD_STATE
2100 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2101 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2103 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2107 #if CYTHON_FAST_THREAD_STATE
2108 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2109 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2111 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2115 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
2118 #if CYTHON_COMPILING_IN_CPYTHON
2119 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2120 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2121 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2122 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2124 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2125 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2126 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2128 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2130 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2132 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2133 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2134 PyListObject* L = (PyListObject*) list;
2135 Py_ssize_t len = Py_SIZE(list);
2136 if (likely(L->allocated > len)) {
2138 PyList_SET_ITEM(list, len, x);
2139 __Pyx_SET_SIZE(list, len + 1);
2142 return PyList_Append(list, x);
2145 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2149 #if !CYTHON_COMPILING_IN_PYPY
2150 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2152 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2153 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2157 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2158 #if CYTHON_COMPILING_IN_CPYTHON
2159 PyObject* none = _PyList_Extend((PyListObject*)L, v);
2160 if (unlikely(!none))
2165 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2170 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2171 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2172 PyListObject* L = (PyListObject*) list;
2173 Py_ssize_t len = Py_SIZE(list);
2174 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2176 PyList_SET_ITEM(list, len, x);
2177 __Pyx_SET_SIZE(list, len + 1);
2180 return PyList_Append(list, x);
2183 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2187 #define __Pyx_init_assertions_enabled()
2188 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2189 #define __pyx_assertions_enabled() (1)
2190 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2191 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2192 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2193 static int __pyx_assertions_enabled_flag;
2194 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2195 #undef __Pyx_init_assertions_enabled
2196 static void __Pyx_init_assertions_enabled(
void) {
2197 __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2200 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2204 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2207 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2208 int result = PySequence_Contains(seq, item);
2209 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2213 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2216 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2219 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2222 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v,
void *a, traverseproc current_tp_traverse);
2225 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2228 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2229 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2231 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2235 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2236 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2238 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2242 #ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36
2243 #define __PYX_HAVE_RT_ImportType_proto_0_29_36
2244 #if __STDC_VERSION__ >= 201112L
2245 #include <stdalign.h>
2247 #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
2248 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s)
2250 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*)
2252 enum __Pyx_ImportType_CheckSize_0_29_36 {
2253 __Pyx_ImportType_CheckSize_Error_0_29_36 = 0,
2254 __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1,
2255 __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2
2257 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_0_29_36 check_size);
2261 static void* __Pyx_GetVtable(PyObject *dict);
2264 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2267 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2270 static int __Pyx_setup_reduce(PyObject* type_obj);
2273 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2276 #define __Pyx_CyFunction_USED 1
2277 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2278 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2279 #define __Pyx_CYFUNCTION_CCLASS 0x04
2280 #define __Pyx_CyFunction_GetClosure(f)\
2281 (((__pyx_CyFunctionObject *) (f))->func_closure)
2282 #define __Pyx_CyFunction_GetClassObj(f)\
2283 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2284 #define __Pyx_CyFunction_Defaults(type, f)\
2285 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2286 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2287 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2289 PyCFunctionObject func;
2290 #if PY_VERSION_HEX < 0x030500A0
2291 PyObject *func_weakreflist;
2293 PyObject *func_dict;
2294 PyObject *func_name;
2295 PyObject *func_qualname;
2297 PyObject *func_globals;
2298 PyObject *func_code;
2299 PyObject *func_closure;
2300 PyObject *func_classobj;
2302 int defaults_pyobjects;
2303 size_t defaults_size;
2305 PyObject *defaults_tuple;
2306 PyObject *defaults_kwdict;
2307 PyObject *(*defaults_getter)(PyObject *);
2308 PyObject *func_annotations;
2309 } __pyx_CyFunctionObject;
2310 static PyTypeObject *__pyx_CyFunctionType = 0;
2311 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2312 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2313 int flags, PyObject* qualname,
2315 PyObject *module, PyObject *globals,
2317 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2320 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2322 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2324 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2326 static int __pyx_CyFunction_init(
void);
2329 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2330 int flags, PyObject* qualname,
2332 PyObject *module, PyObject *globals,
2336 #ifdef CYTHON_CLINE_IN_TRACEBACK
2337 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2339 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2344 PyCodeObject* code_object;
2346 } __Pyx_CodeObjectCacheEntry;
2347 struct __Pyx_CodeObjectCache {
2350 __Pyx_CodeObjectCacheEntry* entries;
2352 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2353 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2354 static PyCodeObject *__pyx_find_code_object(
int code_line);
2355 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2358 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2359 int py_line,
const char *filename);
2361 #if PY_MAJOR_VERSION < 3
2362 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2363 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2365 #define __Pyx_GetBuffer PyObject_GetBuffer
2366 #define __Pyx_ReleaseBuffer PyBuffer_Release
2372 Py_ssize_t shape, strides, suboffsets;
2373 } __Pyx_Buf_DimInfo;
2379 __Pyx_Buffer *rcbuffer;
2381 __Pyx_Buf_DimInfo diminfo[8];
2382 } __Pyx_LocalBuf_ND;
2385 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2388 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2389 __Pyx_memviewslice *slice2,
2390 int ndim,
size_t itemsize);
2393 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2396 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2397 #define __Pyx_HAS_GCC_DIAGNOSTIC
2401 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2404 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2405 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2406 __Pyx_BufFmt_StackElem* stack,
2407 __Pyx_TypeInfo* type);
2410 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2413 static int __Pyx_ValidateAndInit_memviewslice(
2418 __Pyx_TypeInfo *dtype,
2419 __Pyx_BufFmt_StackElem stack[],
2420 __Pyx_memviewslice *memviewslice,
2421 PyObject *original_obj);
2424 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *,
int writable_flag);
2427 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *,
int writable_flag);
2430 #ifndef __Pyx_CppExn2PyErr
2433 #include <stdexcept>
2435 static void __Pyx_CppExn2PyErr() {
2437 if (PyErr_Occurred())
2441 }
catch (
const std::bad_alloc& exn) {
2442 PyErr_SetString(PyExc_MemoryError, exn.what());
2443 }
catch (
const std::bad_cast& exn) {
2444 PyErr_SetString(PyExc_TypeError, exn.what());
2445 }
catch (
const std::bad_typeid& exn) {
2446 PyErr_SetString(PyExc_TypeError, exn.what());
2447 }
catch (
const std::domain_error& exn) {
2448 PyErr_SetString(PyExc_ValueError, exn.what());
2449 }
catch (
const std::invalid_argument& exn) {
2450 PyErr_SetString(PyExc_ValueError, exn.what());
2451 }
catch (
const std::ios_base::failure& exn) {
2452 PyErr_SetString(PyExc_IOError, exn.what());
2453 }
catch (
const std::out_of_range& exn) {
2454 PyErr_SetString(PyExc_IndexError, exn.what());
2455 }
catch (
const std::overflow_error& exn) {
2456 PyErr_SetString(PyExc_OverflowError, exn.what());
2457 }
catch (
const std::range_error& exn) {
2458 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2459 }
catch (
const std::underflow_error& exn) {
2460 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2461 }
catch (
const std::exception& exn) {
2462 PyErr_SetString(PyExc_RuntimeError, exn.what());
2466 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
2472 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *,
int writable_flag);
2475 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *,
int writable_flag);
2478 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *,
int writable_flag);
2481 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *,
int writable_flag);
2484 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *,
int writable_flag);
2487 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2490 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2493 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *,
int writable_flag);
2496 static __Pyx_memviewslice
2497 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2498 const char *mode,
int ndim,
2499 size_t sizeof_dtype,
int contig_flag,
2500 int dtype_is_object);
2503 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2506 static CYTHON_INLINE
LongIndexType __Pyx_PyInt_As_LongIndexType(PyObject *);
2509 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2512 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2515 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2518 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2521 static int __Pyx_check_binary_version(
void);
2524 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2526 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2527 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2528 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2529 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2530 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2531 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2532 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2533 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2534 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2535 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2542 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2553 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = 0;
2554 static PyTypeObject *__pyx_array_type = 0;
2555 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2556 static PyTypeObject *__pyx_memoryview_type = 0;
2557 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2558 static PyObject *
generic = 0;
2559 static PyObject *strided = 0;
2560 static PyObject *indirect = 0;
2561 static PyObject *contiguous = 0;
2562 static PyObject *indirect_contiguous = 0;
2563 static int __pyx_memoryview_thread_locks_used;
2564 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2565 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2566 static void *__pyx_align_pointer(
void *,
size_t);
2567 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2568 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2569 static PyObject *_unellipsify(PyObject *,
int);
2570 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2571 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2572 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2573 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2574 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2575 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2576 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2577 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2578 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2579 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2580 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2581 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2582 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2583 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2584 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2585 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2586 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2587 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2588 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2589 static int __pyx_memoryview_err(PyObject *,
char *);
2590 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2591 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2592 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2593 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2594 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2595 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2596 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2597 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2598 static __Pyx_TypeInfo __Pyx_TypeInfo_float = {
"float", NULL,
sizeof(float), { 0 }, 0,
'R', 0, 0 };
2599 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2600 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = {
"long double", NULL,
sizeof(
long double), { 0 }, 0,
'R', 0, 0 };
2601 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2602 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_affine_matrix_function"
2603 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function;
2604 int __pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function = 0;
2607 static PyObject *__pyx_builtin_ValueError;
2608 static PyObject *__pyx_builtin_TypeError;
2609 static PyObject *__pyx_builtin_MemoryError;
2610 static PyObject *__pyx_builtin_enumerate;
2611 static PyObject *__pyx_builtin_range;
2612 static PyObject *__pyx_builtin_Ellipsis;
2613 static PyObject *__pyx_builtin_id;
2614 static PyObject *__pyx_builtin_IndexError;
2615 static const char __pyx_k_A[] =
"A";
2616 static const char __pyx_k_B[] =
"B";
2617 static const char __pyx_k_O[] =
"O";
2618 static const char __pyx_k_c[] =
"c";
2619 static const char __pyx_k_id[] =
"id";
2620 static const char __pyx_k_new[] =
"__new__";
2621 static const char __pyx_k_obj[] =
"obj";
2622 static const char __pyx_k_base[] =
"base";
2623 static const char __pyx_k_copy[] =
"copy";
2624 static const char __pyx_k_data[] =
"data";
2625 static const char __pyx_k_dict[] =
"__dict__";
2626 static const char __pyx_k_main[] =
"__main__";
2627 static const char __pyx_k_mode[] =
"mode";
2628 static const char __pyx_k_name[] =
"name";
2629 static const char __pyx_k_ndim[] =
"ndim";
2630 static const char __pyx_k_pack[] =
"pack";
2631 static const char __pyx_k_self[] =
"self";
2632 static const char __pyx_k_size[] =
"size";
2633 static const char __pyx_k_step[] =
"step";
2634 static const char __pyx_k_stop[] =
"stop";
2635 static const char __pyx_k_test[] =
"__test__";
2636 static const char __pyx_k_ASCII[] =
"ASCII";
2637 static const char __pyx_k_class[] =
"__class__";
2638 static const char __pyx_k_dtype[] =
"dtype";
2639 static const char __pyx_k_error[] =
"error";
2640 static const char __pyx_k_flags[] =
"flags";
2641 static const char __pyx_k_numpy[] =
"numpy";
2642 static const char __pyx_k_range[] =
"range";
2643 static const char __pyx_k_shape[] =
"shape";
2644 static const char __pyx_k_start[] =
"start";
2645 static const char __pyx_k_A_data[] =
"A_data";
2646 static const char __pyx_k_B_data[] =
"B_data";
2647 static const char __pyx_k_astype[] =
"astype";
2648 static const char __pyx_k_encode[] =
"encode";
2649 static const char __pyx_k_format[] =
"format";
2650 static const char __pyx_k_import[] =
"__import__";
2651 static const char __pyx_k_indptr[] =
"indptr";
2652 static const char __pyx_k_name_2[] =
"__name__";
2653 static const char __pyx_k_pickle[] =
"pickle";
2654 static const char __pyx_k_reduce[] =
"__reduce__";
2655 static const char __pyx_k_struct[] =
"struct";
2656 static const char __pyx_k_unpack[] =
"unpack";
2657 static const char __pyx_k_update[] =
"update";
2658 static const char __pyx_k_float32[] =
"float32";
2659 static const char __pyx_k_float64[] =
"float64";
2660 static const char __pyx_k_fortran[] =
"fortran";
2661 static const char __pyx_k_indices[] =
"indices";
2662 static const char __pyx_k_memview[] =
"memview";
2663 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2664 static const char __pyx_k_float128[] =
"float128";
2665 static const char __pyx_k_getstate[] =
"__getstate__";
2666 static const char __pyx_k_issparse[] =
"issparse";
2667 static const char __pyx_k_itemsize[] =
"itemsize";
2668 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2669 static const char __pyx_k_setstate[] =
"__setstate__";
2670 static const char __pyx_k_A_data_mv[] =
"A_data_mv";
2671 static const char __pyx_k_A_indices[] =
"A_indices";
2672 static const char __pyx_k_B_data_mv[] =
"B_data_mv";
2673 static const char __pyx_k_B_indices[] =
"B_indices";
2674 static const char __pyx_k_TypeError[] =
"TypeError";
2675 static const char __pyx_k_enumerate[] =
"enumerate";
2676 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2677 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2678 static const char __pyx_k_A_num_rows[] =
"A_num_rows";
2679 static const char __pyx_k_IndexError[] =
"IndexError";
2680 static const char __pyx_k_ValueError[] =
"ValueError";
2681 static const char __pyx_k_csr_matrix[] =
"csr_matrix";
2682 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2683 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2684 static const char __pyx_k_A_data_mv_c[] =
"A_data_mv_c";
2685 static const char __pyx_k_A_data_mv_f[] =
"A_data_mv_f";
2686 static const char __pyx_k_B_data_mv_c[] =
"B_data_mv_c";
2687 static const char __pyx_k_B_data_mv_f[] =
"B_data_mv_f";
2688 static const char __pyx_k_MemoryError[] =
"MemoryError";
2689 static const char __pyx_k_PickleError[] =
"PickleError";
2690 static const char __pyx_k_A_indices_mv[] =
"A_indices_mv";
2691 static const char __pyx_k_B_indices_mv[] =
"B_indices_mv";
2692 static const char __pyx_k_C_CONTIGUOUS[] =
"C_CONTIGUOUS";
2693 static const char __pyx_k_F_CONTIGUOUS[] =
"F_CONTIGUOUS";
2694 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2695 static const char __pyx_k_scipy_sparse[] =
"scipy.sparse";
2696 static const char __pyx_k_sort_indices[] =
"sort_indices";
2697 static const char __pyx_k_stringsource[] =
"stringsource";
2698 static const char __pyx_k_A_num_columns[] =
"A_num_columns";
2699 static const char __pyx_k_B_is_identity[] =
"B_is_identity";
2700 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2701 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2702 static const char __pyx_k_A_is_row_major[] =
"A_is_row_major";
2703 static const char __pyx_k_B_is_row_major[] =
"B_is_row_major";
2704 static const char __pyx_k_isspmatrix_csc[] =
"isspmatrix_csc";
2705 static const char __pyx_k_isspmatrix_csr[] =
"isspmatrix_csr";
2706 static const char __pyx_k_A_index_pointer[] =
"A_index_pointer";
2707 static const char __pyx_k_B_index_pointer[] =
"B_index_pointer";
2708 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2709 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2710 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2711 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2712 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2713 static const char __pyx_k_A_cannot_be_None[] =
"A cannot be None.";
2714 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2715 static const char __pyx_k_A_index_pointer_mv[] =
"A_index_pointer_mv";
2716 static const char __pyx_k_B_index_pointer_mv[] =
"B_index_pointer_mv";
2717 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2718 static const char __pyx_k_has_sorted_indices[] =
"has_sorted_indices";
2719 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2720 static const char __pyx_k_set_csc_matrix_float[] =
"set_csc_matrix_float";
2721 static const char __pyx_k_set_csr_matrix_float[] =
"set_csr_matrix_float";
2722 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2723 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2724 static const char __pyx_k_set_csc_matrix_double[] =
"set_csc_matrix_double";
2725 static const char __pyx_k_set_csr_matrix_double[] =
"set_csr_matrix_double";
2726 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2727 static const char __pyx_k_set_dense_matrix_float[] =
"set_dense_matrix_float";
2728 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2729 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2730 static const char __pyx_k_pycAffineMatrixFunction[] =
"pycAffineMatrixFunction";
2731 static const char __pyx_k_set_dense_matrix_double[] =
"set_dense_matrix_double";
2732 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2733 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2734 static const char __pyx_k_set_csc_matrix_long_double[] =
"set_csc_matrix_long_double";
2735 static const char __pyx_k_set_csr_matrix_long_double[] =
"set_csr_matrix_long_double";
2736 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2737 static const char __pyx_k_set_dense_matrix_long_double[] =
"set_dense_matrix_long_double";
2738 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2739 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2740 static const char __pyx_k_pycAffineMatrixFunction_set_csc[] =
"pycAffineMatrixFunction.set_csc_matrix_float";
2741 static const char __pyx_k_pycAffineMatrixFunction_set_csr[] =
"pycAffineMatrixFunction.set_csr_matrix_float";
2742 static const char __pyx_k_A_and_B_should_have_similar_data[] =
"A and B should have similar data types.";
2743 static const char __pyx_k_A_and_B_should_have_the_same_sha[] =
"A and B should have the same shape.";
2744 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2745 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2746 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2747 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2748 static const char __pyx_k_Data_type_should_be_float32_floa[] =
"Data type should be float32, float64, or float128.";
2749 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2750 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2751 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2752 static const char __pyx_k_Input_matrix_should_be_a_2_dimen[] =
"Input matrix should be a 2-dimensional array.";
2753 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2754 static const char __pyx_k_Matrices_A_and_B_should_have_sim[] =
"Matrices A and B should have similar types.";
2755 static const char __pyx_k_Matrix_A_should_be_either_C_or_F[] =
"Matrix A should be either C or F contiguous.";
2756 static const char __pyx_k_Matrix_B_should_be_either_C_or_F[] =
"Matrix B should be either C or F contiguous.";
2757 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2758 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2759 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2760 static const char __pyx_k_imate__c_linear_operator_py_c_af[] =
"imate/_c_linear_operator/py_c_affine_matrix_function.pyx";
2761 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2762 static const char __pyx_k_pycAffineMatrixFunction___reduce[] =
"pycAffineMatrixFunction.__reduce_cython__";
2763 static const char __pyx_k_pycAffineMatrixFunction___setsta[] =
"pycAffineMatrixFunction.__setstate_cython__";
2764 static const char __pyx_k_pycAffineMatrixFunction_set_dens[] =
"pycAffineMatrixFunction.set_dense_matrix_float";
2765 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2766 static const char __pyx_k_pycAffineMatrixFunction_set_csc_2[] =
"pycAffineMatrixFunction.set_csc_matrix_double";
2767 static const char __pyx_k_pycAffineMatrixFunction_set_csc_3[] =
"pycAffineMatrixFunction.set_csc_matrix_long_double";
2768 static const char __pyx_k_pycAffineMatrixFunction_set_csr_2[] =
"pycAffineMatrixFunction.set_csr_matrix_double";
2769 static const char __pyx_k_pycAffineMatrixFunction_set_csr_3[] =
"pycAffineMatrixFunction.set_csr_matrix_long_double";
2770 static const char __pyx_k_imate__c_linear_operator_py_c_af_2[] =
"imate._c_linear_operator.py_c_affine_matrix_function";
2771 static const char __pyx_k_pycAffineMatrixFunction_set_dens_2[] =
"pycAffineMatrixFunction.set_dense_matrix_double";
2772 static const char __pyx_k_pycAffineMatrixFunction_set_dens_3[] =
"pycAffineMatrixFunction.set_dense_matrix_long_double";
2773 static PyObject *__pyx_n_s_A;
2774 static PyObject *__pyx_n_s_ASCII;
2775 static PyObject *__pyx_kp_u_A_and_B_should_have_similar_data;
2776 static PyObject *__pyx_kp_u_A_and_B_should_have_the_same_sha;
2777 static PyObject *__pyx_kp_u_A_cannot_be_None;
2778 static PyObject *__pyx_n_s_A_data;
2779 static PyObject *__pyx_n_s_A_data_mv;
2780 static PyObject *__pyx_n_s_A_data_mv_c;
2781 static PyObject *__pyx_n_s_A_data_mv_f;
2782 static PyObject *__pyx_n_s_A_index_pointer;
2783 static PyObject *__pyx_n_s_A_index_pointer_mv;
2784 static PyObject *__pyx_n_s_A_indices;
2785 static PyObject *__pyx_n_s_A_indices_mv;
2786 static PyObject *__pyx_n_s_A_is_row_major;
2787 static PyObject *__pyx_n_s_A_num_columns;
2788 static PyObject *__pyx_n_s_A_num_rows;
2789 static PyObject *__pyx_n_s_B;
2790 static PyObject *__pyx_n_s_B_data;
2791 static PyObject *__pyx_n_s_B_data_mv;
2792 static PyObject *__pyx_n_s_B_data_mv_c;
2793 static PyObject *__pyx_n_s_B_data_mv_f;
2794 static PyObject *__pyx_n_s_B_index_pointer;
2795 static PyObject *__pyx_n_s_B_index_pointer_mv;
2796 static PyObject *__pyx_n_s_B_indices;
2797 static PyObject *__pyx_n_s_B_indices_mv;
2798 static PyObject *__pyx_n_s_B_is_identity;
2799 static PyObject *__pyx_n_s_B_is_row_major;
2800 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2801 static PyObject *__pyx_n_u_C_CONTIGUOUS;
2802 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2803 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2804 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2805 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2806 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
2807 static PyObject *__pyx_n_s_Ellipsis;
2808 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2809 static PyObject *__pyx_n_u_F_CONTIGUOUS;
2810 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2811 static PyObject *__pyx_n_s_IndexError;
2812 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2813 static PyObject *__pyx_kp_u_Input_matrix_should_be_a_2_dimen;
2814 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2815 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2816 static PyObject *__pyx_kp_u_Matrices_A_and_B_should_have_sim;
2817 static PyObject *__pyx_kp_u_Matrix_A_should_be_either_C_or_F;
2818 static PyObject *__pyx_kp_u_Matrix_B_should_be_either_C_or_F;
2819 static PyObject *__pyx_n_s_MemoryError;
2820 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2821 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2822 static PyObject *__pyx_n_b_O;
2823 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2824 static PyObject *__pyx_n_s_PickleError;
2825 static PyObject *__pyx_n_s_TypeError;
2826 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2827 static PyObject *__pyx_n_s_ValueError;
2828 static PyObject *__pyx_n_s_View_MemoryView;
2829 static PyObject *__pyx_n_s_allocate_buffer;
2830 static PyObject *__pyx_n_s_astype;
2831 static PyObject *__pyx_n_s_base;
2832 static PyObject *__pyx_n_s_c;
2833 static PyObject *__pyx_n_u_c;
2834 static PyObject *__pyx_n_s_class;
2835 static PyObject *__pyx_n_s_cline_in_traceback;
2836 static PyObject *__pyx_kp_s_contiguous_and_direct;
2837 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2838 static PyObject *__pyx_n_s_copy;
2839 static PyObject *__pyx_n_s_csr_matrix;
2840 static PyObject *__pyx_n_s_data;
2841 static PyObject *__pyx_n_s_dict;
2842 static PyObject *__pyx_n_s_dtype;
2843 static PyObject *__pyx_n_s_dtype_is_object;
2844 static PyObject *__pyx_n_s_encode;
2845 static PyObject *__pyx_n_s_enumerate;
2846 static PyObject *__pyx_n_s_error;
2847 static PyObject *__pyx_n_s_flags;
2848 static PyObject *__pyx_n_b_float128;
2849 static PyObject *__pyx_n_b_float32;
2850 static PyObject *__pyx_n_b_float64;
2851 static PyObject *__pyx_n_s_format;
2852 static PyObject *__pyx_n_s_fortran;
2853 static PyObject *__pyx_n_u_fortran;
2854 static PyObject *__pyx_n_s_getstate;
2855 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2856 static PyObject *__pyx_n_s_has_sorted_indices;
2857 static PyObject *__pyx_n_s_id;
2858 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_af;
2859 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_af_2;
2860 static PyObject *__pyx_n_s_import;
2861 static PyObject *__pyx_n_s_indices;
2862 static PyObject *__pyx_n_s_indptr;
2863 static PyObject *__pyx_n_s_issparse;
2864 static PyObject *__pyx_n_s_isspmatrix_csc;
2865 static PyObject *__pyx_n_s_isspmatrix_csr;
2866 static PyObject *__pyx_n_s_itemsize;
2867 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2868 static PyObject *__pyx_n_s_main;
2869 static PyObject *__pyx_n_s_memview;
2870 static PyObject *__pyx_n_s_mode;
2871 static PyObject *__pyx_n_s_name;
2872 static PyObject *__pyx_n_s_name_2;
2873 static PyObject *__pyx_n_s_ndim;
2874 static PyObject *__pyx_n_s_new;
2875 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2876 static PyObject *__pyx_n_s_numpy;
2877 static PyObject *__pyx_n_s_obj;
2878 static PyObject *__pyx_n_s_pack;
2879 static PyObject *__pyx_n_s_pickle;
2880 static PyObject *__pyx_n_s_pycAffineMatrixFunction;
2881 static PyObject *__pyx_n_s_pycAffineMatrixFunction___reduce;
2882 static PyObject *__pyx_n_s_pycAffineMatrixFunction___setsta;
2883 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc;
2884 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc_2;
2885 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc_3;
2886 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr;
2887 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr_2;
2888 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr_3;
2889 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens;
2890 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens_2;
2891 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens_3;
2892 static PyObject *__pyx_n_s_pyx_PickleError;
2893 static PyObject *__pyx_n_s_pyx_checksum;
2894 static PyObject *__pyx_n_s_pyx_getbuffer;
2895 static PyObject *__pyx_n_s_pyx_result;
2896 static PyObject *__pyx_n_s_pyx_state;
2897 static PyObject *__pyx_n_s_pyx_type;
2898 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2899 static PyObject *__pyx_n_s_pyx_vtable;
2900 static PyObject *__pyx_n_s_range;
2901 static PyObject *__pyx_n_s_reduce;
2902 static PyObject *__pyx_n_s_reduce_cython;
2903 static PyObject *__pyx_n_s_reduce_ex;
2904 static PyObject *__pyx_n_s_scipy_sparse;
2905 static PyObject *__pyx_n_s_self;
2906 static PyObject *__pyx_n_s_set_csc_matrix_double;
2907 static PyObject *__pyx_n_s_set_csc_matrix_float;
2908 static PyObject *__pyx_n_s_set_csc_matrix_long_double;
2909 static PyObject *__pyx_n_s_set_csr_matrix_double;
2910 static PyObject *__pyx_n_s_set_csr_matrix_float;
2911 static PyObject *__pyx_n_s_set_csr_matrix_long_double;
2912 static PyObject *__pyx_n_s_set_dense_matrix_double;
2913 static PyObject *__pyx_n_s_set_dense_matrix_float;
2914 static PyObject *__pyx_n_s_set_dense_matrix_long_double;
2915 static PyObject *__pyx_n_s_setstate;
2916 static PyObject *__pyx_n_s_setstate_cython;
2917 static PyObject *__pyx_n_s_shape;
2918 static PyObject *__pyx_n_s_size;
2919 static PyObject *__pyx_n_s_sort_indices;
2920 static PyObject *__pyx_n_s_start;
2921 static PyObject *__pyx_n_s_step;
2922 static PyObject *__pyx_n_s_stop;
2923 static PyObject *__pyx_kp_s_strided_and_direct;
2924 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2925 static PyObject *__pyx_kp_s_strided_and_indirect;
2926 static PyObject *__pyx_kp_s_stringsource;
2927 static PyObject *__pyx_n_s_struct;
2928 static PyObject *__pyx_n_s_test;
2929 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2930 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2931 static PyObject *__pyx_n_s_unpack;
2932 static PyObject *__pyx_n_s_update;
2933 static int __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B);
2934 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2935 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2936 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2937 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2938 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2939 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2940 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2941 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2942 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity);
2943 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self);
2944 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2945 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2946 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2947 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2948 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2949 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2950 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2951 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2952 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2953 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2954 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2955 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2956 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2957 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2958 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2959 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2960 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2961 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2962 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2963 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2964 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2965 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2966 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2967 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2968 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2969 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2970 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2971 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2972 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2973 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2974 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2975 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2976 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2977 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2978 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2979 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2980 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2981 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2982 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2983 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2984 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2985 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2986 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2987 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyTypeObject *t, PyObject *a, PyObject *k);
2988 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2989 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2990 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2991 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2992 static PyObject *__pyx_int_0;
2993 static PyObject *__pyx_int_1;
2994 static PyObject *__pyx_int_2;
2995 static PyObject *__pyx_int_112105877;
2996 static PyObject *__pyx_int_136983863;
2997 static PyObject *__pyx_int_184977713;
2998 static PyObject *__pyx_int_neg_1;
2999 static PyObject *__pyx_tuple_;
3000 static PyObject *__pyx_tuple__2;
3001 static PyObject *__pyx_tuple__3;
3002 static PyObject *__pyx_tuple__4;
3003 static PyObject *__pyx_tuple__5;
3004 static PyObject *__pyx_tuple__6;
3005 static PyObject *__pyx_tuple__8;
3006 static PyObject *__pyx_tuple__9;
3007 static PyObject *__pyx_slice__36;
3008 static PyObject *__pyx_tuple__19;
3009 static PyObject *__pyx_tuple__21;
3010 static PyObject *__pyx_tuple__22;
3011 static PyObject *__pyx_tuple__23;
3012 static PyObject *__pyx_tuple__24;
3013 static PyObject *__pyx_tuple__25;
3014 static PyObject *__pyx_tuple__26;
3015 static PyObject *__pyx_tuple__27;
3016 static PyObject *__pyx_tuple__28;
3017 static PyObject *__pyx_tuple__29;
3018 static PyObject *__pyx_tuple__30;
3019 static PyObject *__pyx_tuple__31;
3020 static PyObject *__pyx_tuple__32;
3021 static PyObject *__pyx_tuple__33;
3022 static PyObject *__pyx_tuple__34;
3023 static PyObject *__pyx_tuple__35;
3024 static PyObject *__pyx_tuple__37;
3025 static PyObject *__pyx_tuple__38;
3026 static PyObject *__pyx_tuple__39;
3027 static PyObject *__pyx_tuple__41;
3028 static PyObject *__pyx_tuple__42;
3029 static PyObject *__pyx_tuple__43;
3030 static PyObject *__pyx_tuple__44;
3031 static PyObject *__pyx_tuple__45;
3032 static PyObject *__pyx_tuple__46;
3033 static PyObject *__pyx_tuple__47;
3034 static PyObject *__pyx_tuple__48;
3035 static PyObject *__pyx_tuple__49;
3036 static PyObject *__pyx_tuple__50;
3037 static PyObject *__pyx_tuple__51;
3038 static PyObject *__pyx_tuple__52;
3039 static PyObject *__pyx_tuple__53;
3040 static PyObject *__pyx_tuple__54;
3041 static PyObject *__pyx_tuple__55;
3042 static PyObject *__pyx_tuple__56;
3043 static PyObject *__pyx_tuple__57;
3044 static PyObject *__pyx_tuple__58;
3045 static PyObject *__pyx_codeobj__7;
3046 static PyObject *__pyx_codeobj__10;
3047 static PyObject *__pyx_codeobj__11;
3048 static PyObject *__pyx_codeobj__12;
3049 static PyObject *__pyx_codeobj__13;
3050 static PyObject *__pyx_codeobj__14;
3051 static PyObject *__pyx_codeobj__15;
3052 static PyObject *__pyx_codeobj__16;
3053 static PyObject *__pyx_codeobj__17;
3054 static PyObject *__pyx_codeobj__18;
3055 static PyObject *__pyx_codeobj__20;
3056 static PyObject *__pyx_codeobj__40;
3068 static int __pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3069 static int __pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3070 PyObject *__pyx_v_A = 0;
3071 PyObject *__pyx_v_B = 0;
3072 int __pyx_lineno = 0;
3073 const char *__pyx_filename = NULL;
3074 int __pyx_clineno = 0;
3076 __Pyx_RefNannyDeclarations
3077 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3079 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,0};
3080 PyObject* values[2] = {0,0};
3081 values[1] = ((PyObject *)Py_None);
3082 if (unlikely(__pyx_kwds)) {
3084 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3086 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3088 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3091 default:
goto __pyx_L5_argtuple_error;
3093 kw_args = PyDict_Size(__pyx_kwds);
3096 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3097 else goto __pyx_L5_argtuple_error;
3101 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B);
3102 if (value) { values[1] = value; kw_args--; }
3105 if (unlikely(kw_args > 0)) {
3106 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 172, __pyx_L3_error)
3109 switch (PyTuple_GET_SIZE(__pyx_args)) {
3110 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3112 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3114 default:
goto __pyx_L5_argtuple_error;
3117 __pyx_v_A = values[0];
3118 __pyx_v_B = values[1];
3120 goto __pyx_L4_argument_unpacking_done;
3121 __pyx_L5_argtuple_error:;
3122 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 172, __pyx_L3_error)
3124 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3125 __Pyx_RefNannyFinishContext();
3127 __pyx_L4_argument_unpacking_done:;
3128 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B);
3131 __Pyx_RefNannyFinishContext();
3135 static int __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B) {
3136 int __pyx_v_B_is_identity;
3138 __Pyx_TraceDeclarations
3139 __Pyx_RefNannyDeclarations
3142 PyObject *__pyx_t_3 = NULL;
3143 PyObject *__pyx_t_4 = NULL;
3144 PyObject *__pyx_t_5 = NULL;
3146 PyObject *__pyx_t_7 = NULL;
3148 PyObject *__pyx_t_9 = NULL;
3149 int __pyx_lineno = 0;
3150 const char *__pyx_filename = NULL;
3151 int __pyx_clineno = 0;
3152 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3153 __Pyx_TraceCall(
"__cinit__", __pyx_f[0], 172, 0, __PYX_ERR(0, 172, __pyx_L1_error));
3162 __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
3163 __pyx_t_1 = (__pyx_v_A == Py_None);
3164 __pyx_t_2 = (__pyx_t_1 != 0);
3165 if (unlikely(__pyx_t_2)) {
3174 __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error))
3175 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
3176 __Pyx_GOTREF(__pyx_t_3);
3177 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3178 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3179 __PYX_ERR(0, 179, __pyx_L1_error)
3197 __Pyx_TraceLine(181,0,__PYX_ERR(0, 181, __pyx_L1_error))
3198 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
3199 __Pyx_GOTREF(__pyx_t_3);
3200 __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_2, 2, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
3201 __Pyx_GOTREF(__pyx_t_4);
3202 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3203 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
3204 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3205 if (unlikely(__pyx_t_2)) {
3214 __Pyx_TraceLine(182,0,__PYX_ERR(0, 182, __pyx_L1_error))
3215 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
3216 __Pyx_GOTREF(__pyx_t_4);
3217 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3218 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3219 __PYX_ERR(0, 182, __pyx_L1_error)
3237 __Pyx_TraceLine(185,0,__PYX_ERR(0, 185, __pyx_L1_error))
3238 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
3239 __Pyx_GOTREF(__pyx_t_4);
3240 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 185, __pyx_L1_error)
3241 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3251 __Pyx_TraceLine(186,0,__PYX_ERR(0, 186, __pyx_L1_error))
3252 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float32");
3271 __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error))
3272 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
3273 __Pyx_GOTREF(__pyx_t_4);
3274 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
3275 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3285 __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
3286 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float64");
3305 __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error))
3306 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
3307 __Pyx_GOTREF(__pyx_t_4);
3308 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
3309 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3310 if (likely(__pyx_t_2)) {
3319 __Pyx_TraceLine(190,0,__PYX_ERR(0, 190, __pyx_L1_error))
3320 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float128");
3339 __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
3341 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
3342 __Pyx_GOTREF(__pyx_t_4);
3343 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3344 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3345 __PYX_ERR(0, 192, __pyx_L1_error)
3356 __Pyx_TraceLine(196,0,__PYX_ERR(0, 196, __pyx_L1_error))
3357 __pyx_t_2 = (__pyx_v_B == Py_None);
3358 __pyx_t_1 = (__pyx_t_2 != 0);
3368 __Pyx_TraceLine(199,0,__PYX_ERR(0, 199, __pyx_L1_error))
3369 __pyx_v_B_is_identity = 1;
3388 __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
3390 __pyx_v_B_is_identity = 0;
3399 __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
3400 __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_A)), ((PyObject *)Py_TYPE(__pyx_v_B)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
3401 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 207, __pyx_L1_error)
3402 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3403 __pyx_t_2 = ((!__pyx_t_1) != 0);
3404 if (unlikely(__pyx_t_2)) {
3413 __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error))
3414 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
3415 __Pyx_GOTREF(__pyx_t_4);
3416 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3417 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3418 __PYX_ERR(0, 208, __pyx_L1_error)
3436 __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error))
3437 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
3438 __Pyx_GOTREF(__pyx_t_4);
3439 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
3440 __Pyx_GOTREF(__pyx_t_3);
3441 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
3442 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3443 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3444 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
3445 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3446 __pyx_t_1 = ((!__pyx_t_2) != 0);
3447 if (unlikely(__pyx_t_1)) {
3456 __Pyx_TraceLine(212,0,__PYX_ERR(0, 212, __pyx_L1_error))
3457 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
3458 __Pyx_GOTREF(__pyx_t_5);
3459 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3460 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3461 __PYX_ERR(0, 212, __pyx_L1_error)
3479 __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error))
3480 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
3481 __Pyx_GOTREF(__pyx_t_5);
3482 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_shape);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
3483 __Pyx_GOTREF(__pyx_t_3);
3484 __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
3485 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3486 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3487 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
3488 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3489 __pyx_t_2 = ((!__pyx_t_1) != 0);
3490 if (unlikely(__pyx_t_2)) {
3499 __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
3500 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
3501 __Pyx_GOTREF(__pyx_t_4);
3502 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3503 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3504 __PYX_ERR(0, 216, __pyx_L1_error)
3524 __Pyx_TraceLine(219,0,__PYX_ERR(0, 219, __pyx_L1_error))
3525 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
3526 __Pyx_GOTREF(__pyx_t_3);
3528 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3529 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3530 if (likely(__pyx_t_5)) {
3531 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3532 __Pyx_INCREF(__pyx_t_5);
3533 __Pyx_INCREF(
function);
3534 __Pyx_DECREF_SET(__pyx_t_3,
function);
3537 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3538 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3539 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
3540 __Pyx_GOTREF(__pyx_t_4);
3541 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3542 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 219, __pyx_L1_error)
3543 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3553 __Pyx_TraceLine(222,0,__PYX_ERR(0, 222, __pyx_L1_error))
3554 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
3555 __Pyx_GOTREF(__pyx_t_3);
3557 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3558 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3559 if (likely(__pyx_t_5)) {
3560 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3561 __Pyx_INCREF(__pyx_t_5);
3562 __Pyx_INCREF(
function);
3563 __Pyx_DECREF_SET(__pyx_t_3,
function);
3566 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3567 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3568 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
3569 __Pyx_GOTREF(__pyx_t_4);
3570 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3571 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 222, __pyx_L1_error)
3572 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3582 __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
3583 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
3584 __Pyx_GOTREF(__pyx_t_4);
3585 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 225, __pyx_L1_error)
3586 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3587 __pyx_t_1 = ((!__pyx_t_2) != 0);
3597 __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
3598 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error)
3599 __Pyx_GOTREF(__pyx_t_3);
3601 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3602 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3603 if (likely(__pyx_t_5)) {
3604 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3605 __Pyx_INCREF(__pyx_t_5);
3606 __Pyx_INCREF(
function);
3607 __Pyx_DECREF_SET(__pyx_t_3,
function);
3610 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3611 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3612 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
3613 __Pyx_GOTREF(__pyx_t_4);
3614 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3615 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3633 __Pyx_TraceLine(228,0,__PYX_ERR(0, 228, __pyx_L1_error))
3634 __pyx_t_2 = ((!(__pyx_v_B_is_identity != 0)) != 0);
3637 __pyx_t_1 = __pyx_t_2;
3638 goto __pyx_L14_bool_binop_done;
3640 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
3641 __Pyx_GOTREF(__pyx_t_4);
3642 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 228, __pyx_L1_error)
3643 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3644 __pyx_t_6 = ((!__pyx_t_2) != 0);
3645 __pyx_t_1 = __pyx_t_6;
3646 __pyx_L14_bool_binop_done:;
3656 __Pyx_TraceLine(229,0,__PYX_ERR(0, 229, __pyx_L1_error))
3657 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
3658 __Pyx_GOTREF(__pyx_t_3);
3660 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3661 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3662 if (likely(__pyx_t_5)) {
3663 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3664 __Pyx_INCREF(__pyx_t_5);
3665 __Pyx_INCREF(
function);
3666 __Pyx_DECREF_SET(__pyx_t_3,
function);
3669 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3670 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3671 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
3672 __Pyx_GOTREF(__pyx_t_4);
3673 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3674 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3692 __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
3693 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
3694 __Pyx_GOTREF(__pyx_t_4);
3695 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
3696 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3706 __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
3707 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
3708 __Pyx_GOTREF(__pyx_t_3);
3709 __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error)
3710 __Pyx_GOTREF(__pyx_t_5);
3713 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3714 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
3715 if (likely(__pyx_t_7)) {
3716 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3717 __Pyx_INCREF(__pyx_t_7);
3718 __Pyx_INCREF(
function);
3719 __Pyx_DECREF_SET(__pyx_t_3,
function);
3723 #if CYTHON_FAST_PYCALL
3724 if (PyFunction_Check(__pyx_t_3)) {
3725 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3726 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3727 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3728 __Pyx_GOTREF(__pyx_t_4);
3729 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3732 #if CYTHON_FAST_PYCCALL
3733 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3734 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3735 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3736 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3737 __Pyx_GOTREF(__pyx_t_4);
3738 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3742 __pyx_t_9 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error)
3743 __Pyx_GOTREF(__pyx_t_9);
3745 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
3747 __Pyx_INCREF(__pyx_v_A);
3748 __Pyx_GIVEREF(__pyx_v_A);
3749 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
3750 __Pyx_INCREF(__pyx_v_B);
3751 __Pyx_GIVEREF(__pyx_v_B);
3752 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
3753 __Pyx_GIVEREF(__pyx_t_5);
3754 PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
3756 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3757 __Pyx_GOTREF(__pyx_t_4);
3758 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3760 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3761 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3780 __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
3781 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
3782 __Pyx_GOTREF(__pyx_t_4);
3783 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
3784 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3794 __Pyx_TraceLine(236,0,__PYX_ERR(0, 236, __pyx_L1_error))
3795 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
3796 __Pyx_GOTREF(__pyx_t_3);
3797 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 236, __pyx_L1_error)
3798 __Pyx_GOTREF(__pyx_t_9);
3801 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3802 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3803 if (likely(__pyx_t_5)) {
3804 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3805 __Pyx_INCREF(__pyx_t_5);
3806 __Pyx_INCREF(
function);
3807 __Pyx_DECREF_SET(__pyx_t_3,
function);
3811 #if CYTHON_FAST_PYCALL
3812 if (PyFunction_Check(__pyx_t_3)) {
3813 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
3814 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3815 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3816 __Pyx_GOTREF(__pyx_t_4);
3817 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3820 #if CYTHON_FAST_PYCCALL
3821 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3822 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
3823 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3824 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3825 __Pyx_GOTREF(__pyx_t_4);
3826 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3830 __pyx_t_7 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error)
3831 __Pyx_GOTREF(__pyx_t_7);
3833 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
3835 __Pyx_INCREF(__pyx_v_A);
3836 __Pyx_GIVEREF(__pyx_v_A);
3837 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
3838 __Pyx_INCREF(__pyx_v_B);
3839 __Pyx_GIVEREF(__pyx_v_B);
3840 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
3841 __Pyx_GIVEREF(__pyx_t_9);
3842 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
3844 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3845 __Pyx_GOTREF(__pyx_t_4);
3846 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3848 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3849 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3868 __Pyx_TraceLine(238,0,__PYX_ERR(0, 238, __pyx_L1_error))
3869 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error)
3870 __Pyx_GOTREF(__pyx_t_4);
3871 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
3872 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3882 __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error))
3883 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
3884 __Pyx_GOTREF(__pyx_t_3);
3885 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error)
3886 __Pyx_GOTREF(__pyx_t_7);
3889 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3890 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
3891 if (likely(__pyx_t_9)) {
3892 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3893 __Pyx_INCREF(__pyx_t_9);
3894 __Pyx_INCREF(
function);
3895 __Pyx_DECREF_SET(__pyx_t_3,
function);
3899 #if CYTHON_FAST_PYCALL
3900 if (PyFunction_Check(__pyx_t_3)) {
3901 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
3902 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3903 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3904 __Pyx_GOTREF(__pyx_t_4);
3905 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3908 #if CYTHON_FAST_PYCCALL
3909 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3910 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
3911 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3912 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3913 __Pyx_GOTREF(__pyx_t_4);
3914 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3918 __pyx_t_5 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error)
3919 __Pyx_GOTREF(__pyx_t_5);
3921 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
3923 __Pyx_INCREF(__pyx_v_A);
3924 __Pyx_GIVEREF(__pyx_v_A);
3925 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
3926 __Pyx_INCREF(__pyx_v_B);
3927 __Pyx_GIVEREF(__pyx_v_B);
3928 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
3929 __Pyx_GIVEREF(__pyx_t_7);
3930 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
3932 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3933 __Pyx_GOTREF(__pyx_t_4);
3934 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3936 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3937 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3966 __Pyx_TraceLine(241,0,__PYX_ERR(0, 241, __pyx_L1_error))
3967 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csc);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
3968 __Pyx_GOTREF(__pyx_t_3);
3970 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3971 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3972 if (likely(__pyx_t_5)) {
3973 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3974 __Pyx_INCREF(__pyx_t_5);
3975 __Pyx_INCREF(
function);
3976 __Pyx_DECREF_SET(__pyx_t_3,
function);
3979 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3980 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3981 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
3982 __Pyx_GOTREF(__pyx_t_4);
3983 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3984 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 241, __pyx_L1_error)
3985 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3995 __Pyx_TraceLine(244,0,__PYX_ERR(0, 244, __pyx_L1_error))
3996 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
3997 __Pyx_GOTREF(__pyx_t_4);
3998 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
3999 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4000 __pyx_t_6 = ((!__pyx_t_1) != 0);
4010 __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
4011 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
4012 __Pyx_GOTREF(__pyx_t_3);
4014 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4015 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4016 if (likely(__pyx_t_5)) {
4017 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4018 __Pyx_INCREF(__pyx_t_5);
4019 __Pyx_INCREF(
function);
4020 __Pyx_DECREF_SET(__pyx_t_3,
function);
4023 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4024 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4025 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error)
4026 __Pyx_GOTREF(__pyx_t_4);
4027 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4028 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4046 __Pyx_TraceLine(247,0,__PYX_ERR(0, 247, __pyx_L1_error))
4047 __pyx_t_1 = ((!(__pyx_v_B_is_identity != 0)) != 0);
4050 __pyx_t_6 = __pyx_t_1;
4051 goto __pyx_L19_bool_binop_done;
4053 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
4054 __Pyx_GOTREF(__pyx_t_4);
4055 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 247, __pyx_L1_error)
4056 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4057 __pyx_t_2 = ((!__pyx_t_1) != 0);
4058 __pyx_t_6 = __pyx_t_2;
4059 __pyx_L19_bool_binop_done:;
4069 __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
4070 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
4071 __Pyx_GOTREF(__pyx_t_3);
4073 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4074 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4075 if (likely(__pyx_t_5)) {
4076 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4077 __Pyx_INCREF(__pyx_t_5);
4078 __Pyx_INCREF(
function);
4079 __Pyx_DECREF_SET(__pyx_t_3,
function);
4082 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4083 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4084 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
4085 __Pyx_GOTREF(__pyx_t_4);
4086 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4087 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4105 __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
4106 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
4107 __Pyx_GOTREF(__pyx_t_4);
4108 __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 251, __pyx_L1_error)
4109 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4119 __Pyx_TraceLine(252,0,__PYX_ERR(0, 252, __pyx_L1_error))
4120 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
4121 __Pyx_GOTREF(__pyx_t_3);
4122 __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
4123 __Pyx_GOTREF(__pyx_t_5);
4126 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4127 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4128 if (likely(__pyx_t_7)) {
4129 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4130 __Pyx_INCREF(__pyx_t_7);
4131 __Pyx_INCREF(
function);
4132 __Pyx_DECREF_SET(__pyx_t_3,
function);
4136 #if CYTHON_FAST_PYCALL
4137 if (PyFunction_Check(__pyx_t_3)) {
4138 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4139 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
4140 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4141 __Pyx_GOTREF(__pyx_t_4);
4142 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4145 #if CYTHON_FAST_PYCCALL
4146 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4147 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4148 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
4149 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4150 __Pyx_GOTREF(__pyx_t_4);
4151 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4155 __pyx_t_9 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 252, __pyx_L1_error)
4156 __Pyx_GOTREF(__pyx_t_9);
4158 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4160 __Pyx_INCREF(__pyx_v_A);
4161 __Pyx_GIVEREF(__pyx_v_A);
4162 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
4163 __Pyx_INCREF(__pyx_v_B);
4164 __Pyx_GIVEREF(__pyx_v_B);
4165 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
4166 __Pyx_GIVEREF(__pyx_t_5);
4167 PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4169 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
4170 __Pyx_GOTREF(__pyx_t_4);
4171 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4173 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4174 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4193 __Pyx_TraceLine(254,0,__PYX_ERR(0, 254, __pyx_L1_error))
4194 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
4195 __Pyx_GOTREF(__pyx_t_4);
4196 __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 254, __pyx_L1_error)
4197 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4207 __Pyx_TraceLine(255,0,__PYX_ERR(0, 255, __pyx_L1_error))
4208 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error)
4209 __Pyx_GOTREF(__pyx_t_3);
4210 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 255, __pyx_L1_error)
4211 __Pyx_GOTREF(__pyx_t_9);
4214 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4215 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4216 if (likely(__pyx_t_5)) {
4217 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4218 __Pyx_INCREF(__pyx_t_5);
4219 __Pyx_INCREF(
function);
4220 __Pyx_DECREF_SET(__pyx_t_3,
function);
4224 #if CYTHON_FAST_PYCALL
4225 if (PyFunction_Check(__pyx_t_3)) {
4226 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4227 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4228 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4229 __Pyx_GOTREF(__pyx_t_4);
4230 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4233 #if CYTHON_FAST_PYCCALL
4234 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4235 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4236 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4237 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4238 __Pyx_GOTREF(__pyx_t_4);
4239 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4243 __pyx_t_7 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
4244 __Pyx_GOTREF(__pyx_t_7);
4246 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4248 __Pyx_INCREF(__pyx_v_A);
4249 __Pyx_GIVEREF(__pyx_v_A);
4250 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
4251 __Pyx_INCREF(__pyx_v_B);
4252 __Pyx_GIVEREF(__pyx_v_B);
4253 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
4254 __Pyx_GIVEREF(__pyx_t_9);
4255 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
4257 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4258 __Pyx_GOTREF(__pyx_t_4);
4259 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4261 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4262 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4281 __Pyx_TraceLine(257,0,__PYX_ERR(0, 257, __pyx_L1_error))
4282 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
4283 __Pyx_GOTREF(__pyx_t_4);
4284 __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
4285 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4295 __Pyx_TraceLine(258,0,__PYX_ERR(0, 258, __pyx_L1_error))
4296 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
4297 __Pyx_GOTREF(__pyx_t_3);
4298 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
4299 __Pyx_GOTREF(__pyx_t_7);
4302 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4303 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
4304 if (likely(__pyx_t_9)) {
4305 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4306 __Pyx_INCREF(__pyx_t_9);
4307 __Pyx_INCREF(
function);
4308 __Pyx_DECREF_SET(__pyx_t_3,
function);
4312 #if CYTHON_FAST_PYCALL
4313 if (PyFunction_Check(__pyx_t_3)) {
4314 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4315 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4316 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4317 __Pyx_GOTREF(__pyx_t_4);
4318 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4321 #if CYTHON_FAST_PYCCALL
4322 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4323 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4324 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4325 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4326 __Pyx_GOTREF(__pyx_t_4);
4327 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4331 __pyx_t_5 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
4332 __Pyx_GOTREF(__pyx_t_5);
4334 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
4336 __Pyx_INCREF(__pyx_v_A);
4337 __Pyx_GIVEREF(__pyx_v_A);
4338 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
4339 __Pyx_INCREF(__pyx_v_B);
4340 __Pyx_GIVEREF(__pyx_v_B);
4341 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
4342 __Pyx_GIVEREF(__pyx_t_7);
4343 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
4345 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4346 __Pyx_GOTREF(__pyx_t_4);
4347 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4349 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4350 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4379 __Pyx_TraceLine(263,0,__PYX_ERR(0, 263, __pyx_L1_error))
4381 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
4382 __Pyx_GOTREF(__pyx_t_3);
4384 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4385 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4386 if (likely(__pyx_t_5)) {
4387 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4388 __Pyx_INCREF(__pyx_t_5);
4389 __Pyx_INCREF(
function);
4390 __Pyx_DECREF_SET(__pyx_t_3,
function);
4393 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4394 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4395 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
4396 __Pyx_GOTREF(__pyx_t_4);
4397 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4398 __Pyx_GIVEREF(__pyx_t_4);
4399 __Pyx_GOTREF(__pyx_v_self->A_csr);
4400 __Pyx_DECREF(__pyx_v_self->A_csr);
4401 __pyx_v_self->A_csr = __pyx_t_4;
4411 __Pyx_TraceLine(265,0,__PYX_ERR(0, 265, __pyx_L1_error))
4412 __pyx_t_6 = ((!(__pyx_v_B_is_identity != 0)) != 0);
4422 __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error))
4423 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
4424 __Pyx_GOTREF(__pyx_t_3);
4426 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4427 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4428 if (likely(__pyx_t_5)) {
4429 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4430 __Pyx_INCREF(__pyx_t_5);
4431 __Pyx_INCREF(
function);
4432 __Pyx_DECREF_SET(__pyx_t_3,
function);
4435 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_B) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_B);
4436 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4437 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
4438 __Pyx_GOTREF(__pyx_t_4);
4439 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4440 __Pyx_GIVEREF(__pyx_t_4);
4441 __Pyx_GOTREF(__pyx_v_self->B_csr);
4442 __Pyx_DECREF(__pyx_v_self->B_csr);
4443 __pyx_v_self->B_csr = __pyx_t_4;
4463 __Pyx_TraceLine(268,0,__PYX_ERR(0, 268, __pyx_L1_error))
4465 __Pyx_INCREF(__pyx_v_B);
4466 __Pyx_GIVEREF(__pyx_v_B);
4467 __Pyx_GOTREF(__pyx_v_self->B_csr);
4468 __Pyx_DECREF(__pyx_v_self->B_csr);
4469 __pyx_v_self->B_csr = __pyx_v_B;
4480 __Pyx_TraceLine(271,0,__PYX_ERR(0, 271, __pyx_L1_error))
4481 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
4482 __Pyx_GOTREF(__pyx_t_4);
4483 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
4484 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4485 __pyx_t_2 = ((!__pyx_t_6) != 0);
4495 __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
4496 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
4497 __Pyx_GOTREF(__pyx_t_3);
4499 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4500 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4501 if (likely(__pyx_t_5)) {
4502 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4503 __Pyx_INCREF(__pyx_t_5);
4504 __Pyx_INCREF(
function);
4505 __Pyx_DECREF_SET(__pyx_t_3,
function);
4508 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4509 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4510 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
4511 __Pyx_GOTREF(__pyx_t_4);
4512 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4513 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4531 __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error))
4532 __pyx_t_6 = ((!(__pyx_v_B_is_identity != 0)) != 0);
4535 __pyx_t_2 = __pyx_t_6;
4536 goto __pyx_L25_bool_binop_done;
4538 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->B_csr, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
4539 __Pyx_GOTREF(__pyx_t_4);
4540 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 274, __pyx_L1_error)
4541 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4542 __pyx_t_1 = ((!__pyx_t_6) != 0);
4543 __pyx_t_2 = __pyx_t_1;
4544 __pyx_L25_bool_binop_done:;
4554 __Pyx_TraceLine(275,0,__PYX_ERR(0, 275, __pyx_L1_error))
4555 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->B_csr, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
4556 __Pyx_GOTREF(__pyx_t_3);
4558 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4559 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4560 if (likely(__pyx_t_5)) {
4561 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4562 __Pyx_INCREF(__pyx_t_5);
4563 __Pyx_INCREF(
function);
4564 __Pyx_DECREF_SET(__pyx_t_3,
function);
4567 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4568 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4569 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
4570 __Pyx_GOTREF(__pyx_t_4);
4571 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4572 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4590 __Pyx_TraceLine(278,0,__PYX_ERR(0, 278, __pyx_L1_error))
4591 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
4592 __Pyx_GOTREF(__pyx_t_4);
4593 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
4594 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4604 __Pyx_TraceLine(279,0,__PYX_ERR(0, 279, __pyx_L1_error))
4605 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
4606 __Pyx_GOTREF(__pyx_t_3);
4615 __Pyx_TraceLine(280,0,__PYX_ERR(0, 280, __pyx_L1_error))
4616 __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
4617 __Pyx_GOTREF(__pyx_t_5);
4620 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4621 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4622 if (likely(__pyx_t_7)) {
4623 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4624 __Pyx_INCREF(__pyx_t_7);
4625 __Pyx_INCREF(
function);
4626 __Pyx_DECREF_SET(__pyx_t_3,
function);
4630 #if CYTHON_FAST_PYCALL
4631 if (PyFunction_Check(__pyx_t_3)) {
4632 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_5};
4633 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4634 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4635 __Pyx_GOTREF(__pyx_t_4);
4636 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4639 #if CYTHON_FAST_PYCCALL
4640 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4641 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_5};
4642 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4643 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4644 __Pyx_GOTREF(__pyx_t_4);
4645 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4649 __pyx_t_9 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error)
4650 __Pyx_GOTREF(__pyx_t_9);
4652 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4654 __Pyx_INCREF(__pyx_v_self->A_csr);
4655 __Pyx_GIVEREF(__pyx_v_self->A_csr);
4656 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_self->A_csr);
4657 __Pyx_INCREF(__pyx_v_self->B_csr);
4658 __Pyx_GIVEREF(__pyx_v_self->B_csr);
4659 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_self->B_csr);
4660 __Pyx_GIVEREF(__pyx_t_5);
4661 PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4663 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4664 __Pyx_GOTREF(__pyx_t_4);
4665 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4667 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4668 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4687 __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
4688 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
4689 __Pyx_GOTREF(__pyx_t_4);
4690 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 282, __pyx_L1_error)
4691 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4701 __Pyx_TraceLine(283,0,__PYX_ERR(0, 283, __pyx_L1_error))
4702 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
4703 __Pyx_GOTREF(__pyx_t_3);
4712 __Pyx_TraceLine(284,0,__PYX_ERR(0, 284, __pyx_L1_error))
4713 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 284, __pyx_L1_error)
4714 __Pyx_GOTREF(__pyx_t_9);
4717 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4718 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4719 if (likely(__pyx_t_5)) {
4720 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4721 __Pyx_INCREF(__pyx_t_5);
4722 __Pyx_INCREF(
function);
4723 __Pyx_DECREF_SET(__pyx_t_3,
function);
4727 #if CYTHON_FAST_PYCALL
4728 if (PyFunction_Check(__pyx_t_3)) {
4729 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_9};
4730 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4731 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4732 __Pyx_GOTREF(__pyx_t_4);
4733 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4736 #if CYTHON_FAST_PYCCALL
4737 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4738 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_9};
4739 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4740 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4741 __Pyx_GOTREF(__pyx_t_4);
4742 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4746 __pyx_t_7 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
4747 __Pyx_GOTREF(__pyx_t_7);
4749 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4751 __Pyx_INCREF(__pyx_v_self->A_csr);
4752 __Pyx_GIVEREF(__pyx_v_self->A_csr);
4753 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_self->A_csr);
4754 __Pyx_INCREF(__pyx_v_self->B_csr);
4755 __Pyx_GIVEREF(__pyx_v_self->B_csr);
4756 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_self->B_csr);
4757 __Pyx_GIVEREF(__pyx_t_9);
4758 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
4760 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4761 __Pyx_GOTREF(__pyx_t_4);
4762 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4764 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4765 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4784 __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error))
4785 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
4786 __Pyx_GOTREF(__pyx_t_4);
4787 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
4788 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4798 __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4799 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
4800 __Pyx_GOTREF(__pyx_t_3);
4809 __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4810 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error)
4811 __Pyx_GOTREF(__pyx_t_7);
4814 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4815 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
4816 if (likely(__pyx_t_9)) {
4817 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4818 __Pyx_INCREF(__pyx_t_9);
4819 __Pyx_INCREF(
function);
4820 __Pyx_DECREF_SET(__pyx_t_3,
function);
4824 #if CYTHON_FAST_PYCALL
4825 if (PyFunction_Check(__pyx_t_3)) {
4826 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_7};
4827 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4828 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4829 __Pyx_GOTREF(__pyx_t_4);
4830 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4833 #if CYTHON_FAST_PYCCALL
4834 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4835 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_7};
4836 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4837 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4838 __Pyx_GOTREF(__pyx_t_4);
4839 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4843 __pyx_t_5 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
4844 __Pyx_GOTREF(__pyx_t_5);
4846 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
4848 __Pyx_INCREF(__pyx_v_self->A_csr);
4849 __Pyx_GIVEREF(__pyx_v_self->A_csr);
4850 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_self->A_csr);
4851 __Pyx_INCREF(__pyx_v_self->B_csr);
4852 __Pyx_GIVEREF(__pyx_v_self->B_csr);
4853 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_self->B_csr);
4854 __Pyx_GIVEREF(__pyx_t_7);
4855 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
4857 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4858 __Pyx_GOTREF(__pyx_t_4);
4859 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4861 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4862 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4893 __Pyx_TraceLine(293,0,__PYX_ERR(0, 293, __pyx_L1_error))
4895 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
4896 __Pyx_GOTREF(__pyx_t_4);
4897 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 293, __pyx_L1_error)
4898 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4908 __Pyx_TraceLine(294,0,__PYX_ERR(0, 294, __pyx_L1_error))
4909 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
4910 __Pyx_GOTREF(__pyx_t_3);
4911 __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error)
4912 __Pyx_GOTREF(__pyx_t_5);
4915 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4916 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4917 if (likely(__pyx_t_7)) {
4918 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4919 __Pyx_INCREF(__pyx_t_7);
4920 __Pyx_INCREF(
function);
4921 __Pyx_DECREF_SET(__pyx_t_3,
function);
4925 #if CYTHON_FAST_PYCALL
4926 if (PyFunction_Check(__pyx_t_3)) {
4927 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4928 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4929 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4930 __Pyx_GOTREF(__pyx_t_4);
4931 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4934 #if CYTHON_FAST_PYCCALL
4935 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4936 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4937 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4938 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4939 __Pyx_GOTREF(__pyx_t_4);
4940 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4944 __pyx_t_9 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 294, __pyx_L1_error)
4945 __Pyx_GOTREF(__pyx_t_9);
4947 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4949 __Pyx_INCREF(__pyx_v_A);
4950 __Pyx_GIVEREF(__pyx_v_A);
4951 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
4952 __Pyx_INCREF(__pyx_v_B);
4953 __Pyx_GIVEREF(__pyx_v_B);
4954 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
4955 __Pyx_GIVEREF(__pyx_t_5);
4956 PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4958 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4959 __Pyx_GOTREF(__pyx_t_4);
4960 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4962 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4963 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4982 __Pyx_TraceLine(296,0,__PYX_ERR(0, 296, __pyx_L1_error))
4983 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
4984 __Pyx_GOTREF(__pyx_t_4);
4985 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
4986 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4996 __Pyx_TraceLine(297,0,__PYX_ERR(0, 297, __pyx_L1_error))
4997 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
4998 __Pyx_GOTREF(__pyx_t_3);
4999 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 297, __pyx_L1_error)
5000 __Pyx_GOTREF(__pyx_t_9);
5003 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
5004 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
5005 if (likely(__pyx_t_5)) {
5006 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5007 __Pyx_INCREF(__pyx_t_5);
5008 __Pyx_INCREF(
function);
5009 __Pyx_DECREF_SET(__pyx_t_3,
function);
5013 #if CYTHON_FAST_PYCALL
5014 if (PyFunction_Check(__pyx_t_3)) {
5015 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
5016 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
5017 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5018 __Pyx_GOTREF(__pyx_t_4);
5019 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5022 #if CYTHON_FAST_PYCCALL
5023 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5024 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
5025 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
5026 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5027 __Pyx_GOTREF(__pyx_t_4);
5028 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5032 __pyx_t_7 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error)
5033 __Pyx_GOTREF(__pyx_t_7);
5035 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
5037 __Pyx_INCREF(__pyx_v_A);
5038 __Pyx_GIVEREF(__pyx_v_A);
5039 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
5040 __Pyx_INCREF(__pyx_v_B);
5041 __Pyx_GIVEREF(__pyx_v_B);
5042 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
5043 __Pyx_GIVEREF(__pyx_t_9);
5044 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
5046 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
5047 __Pyx_GOTREF(__pyx_t_4);
5048 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5050 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5051 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5070 __Pyx_TraceLine(299,0,__PYX_ERR(0, 299, __pyx_L1_error))
5071 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
5072 __Pyx_GOTREF(__pyx_t_4);
5073 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
5074 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5084 __Pyx_TraceLine(300,0,__PYX_ERR(0, 300, __pyx_L1_error))
5085 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
5086 __Pyx_GOTREF(__pyx_t_3);
5087 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error)
5088 __Pyx_GOTREF(__pyx_t_7);
5091 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
5092 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
5093 if (likely(__pyx_t_9)) {
5094 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5095 __Pyx_INCREF(__pyx_t_9);
5096 __Pyx_INCREF(
function);
5097 __Pyx_DECREF_SET(__pyx_t_3,
function);
5101 #if CYTHON_FAST_PYCALL
5102 if (PyFunction_Check(__pyx_t_3)) {
5103 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
5104 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
5105 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5106 __Pyx_GOTREF(__pyx_t_4);
5107 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5110 #if CYTHON_FAST_PYCCALL
5111 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5112 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
5113 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
5114 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5115 __Pyx_GOTREF(__pyx_t_4);
5116 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5120 __pyx_t_5 = PyTuple_New(3+__pyx_t_8);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
5121 __Pyx_GOTREF(__pyx_t_5);
5123 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
5125 __Pyx_INCREF(__pyx_v_A);
5126 __Pyx_GIVEREF(__pyx_v_A);
5127 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
5128 __Pyx_INCREF(__pyx_v_B);
5129 __Pyx_GIVEREF(__pyx_v_B);
5130 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
5131 __Pyx_GIVEREF(__pyx_t_7);
5132 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
5134 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
5135 __Pyx_GOTREF(__pyx_t_4);
5136 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5138 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5139 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5165 __Pyx_XDECREF(__pyx_t_3);
5166 __Pyx_XDECREF(__pyx_t_4);
5167 __Pyx_XDECREF(__pyx_t_5);
5168 __Pyx_XDECREF(__pyx_t_7);
5169 __Pyx_XDECREF(__pyx_t_9);
5170 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5173 __Pyx_TraceReturn(Py_None, 0);
5174 __Pyx_RefNannyFinishContext();
5187 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5188 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float[] =
"pycAffineMatrixFunction.set_dense_matrix_float(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
5189 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float = {
"set_dense_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float};
5190 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5191 PyObject *__pyx_v_A = 0;
5192 PyObject *__pyx_v_B = 0;
5193 PyObject *__pyx_v_B_is_identity = 0;
5194 int __pyx_lineno = 0;
5195 const char *__pyx_filename = NULL;
5196 int __pyx_clineno = 0;
5197 PyObject *__pyx_r = 0;
5198 __Pyx_RefNannyDeclarations
5199 __Pyx_RefNannySetupContext(
"set_dense_matrix_float (wrapper)", 0);
5201 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
5202 PyObject* values[3] = {0,0,0};
5203 if (unlikely(__pyx_kwds)) {
5205 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5207 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5209 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5211 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5214 default:
goto __pyx_L5_argtuple_error;
5216 kw_args = PyDict_Size(__pyx_kwds);
5219 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5220 else goto __pyx_L5_argtuple_error;
5223 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
5225 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 306, __pyx_L3_error)
5229 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
5231 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 306, __pyx_L3_error)
5234 if (unlikely(kw_args > 0)) {
5235 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_dense_matrix_float") < 0)) __PYX_ERR(0, 306, __pyx_L3_error)
5237 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5238 goto __pyx_L5_argtuple_error;
5240 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5241 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5242 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5244 __pyx_v_A = values[0];
5245 __pyx_v_B = values[1];
5246 __pyx_v_B_is_identity = values[2];
5248 goto __pyx_L4_argument_unpacking_done;
5249 __pyx_L5_argtuple_error:;
5250 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 306, __pyx_L3_error)
5252 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5253 __Pyx_RefNannyFinishContext();
5255 __pyx_L4_argument_unpacking_done:;
5256 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
5259 __Pyx_RefNannyFinishContext();
5263 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
5266 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
5267 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
5268 __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5269 __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5270 __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5271 __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5272 float *__pyx_v_A_data;
5273 float *__pyx_v_B_data;
5274 PyObject *__pyx_r = NULL;
5275 __Pyx_TraceDeclarations
5276 __Pyx_RefNannyDeclarations
5277 PyObject *__pyx_t_1 = NULL;
5278 PyObject *__pyx_t_2 = NULL;
5282 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5283 __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5284 Py_ssize_t __pyx_t_8;
5285 Py_ssize_t __pyx_t_9;
5287 int __pyx_lineno = 0;
5288 const char *__pyx_filename = NULL;
5289 int __pyx_clineno = 0;
5290 __Pyx_TraceFrameInit(__pyx_codeobj__7)
5291 __Pyx_RefNannySetupContext(
"set_dense_matrix_float", 0);
5292 __Pyx_TraceCall(
"set_dense_matrix_float", __pyx_f[0], 306, 0, __PYX_ERR(0, 306, __pyx_L1_error));
5301 __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error))
5302 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
5303 __Pyx_GOTREF(__pyx_t_1);
5304 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
5305 __Pyx_GOTREF(__pyx_t_2);
5306 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5307 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error)
5308 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5309 __pyx_v_A_num_rows = __pyx_t_3;
5318 __Pyx_TraceLine(316,0,__PYX_ERR(0, 316, __pyx_L1_error))
5319 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
5320 __Pyx_GOTREF(__pyx_t_2);
5321 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
5322 __Pyx_GOTREF(__pyx_t_1);
5323 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5324 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error)
5325 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5326 __pyx_v_A_num_columns = __pyx_t_3;
5335 __Pyx_TraceLine(320,0,__PYX_ERR(0, 320, __pyx_L1_error))
5336 __pyx_v_B_is_row_major = 0;
5345 __Pyx_TraceLine(322,0,__PYX_ERR(0, 322, __pyx_L1_error))
5346 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
5347 __Pyx_GOTREF(__pyx_t_1);
5348 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
5349 __Pyx_GOTREF(__pyx_t_2);
5350 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5351 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 322, __pyx_L1_error)
5352 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5362 __Pyx_TraceLine(323,0,__PYX_ERR(0, 323, __pyx_L1_error))
5363 __pyx_v_A_is_row_major = 1;
5382 __Pyx_TraceLine(324,0,__PYX_ERR(0, 324, __pyx_L1_error))
5383 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
5384 __Pyx_GOTREF(__pyx_t_2);
5385 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
5386 __Pyx_GOTREF(__pyx_t_1);
5387 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5388 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 324, __pyx_L1_error)
5389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5390 if (likely(__pyx_t_4)) {
5399 __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error))
5400 __pyx_v_A_is_row_major = 0;
5419 __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error))
5421 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
5422 __Pyx_GOTREF(__pyx_t_1);
5423 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5424 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5425 __PYX_ERR(0, 327, __pyx_L1_error)
5436 __Pyx_TraceLine(329,0,__PYX_ERR(0, 329, __pyx_L1_error))
5437 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 329, __pyx_L1_error)
5438 __pyx_t_5 = ((!__pyx_t_4) != 0);
5448 __Pyx_TraceLine(330,0,__PYX_ERR(0, 330, __pyx_L1_error))
5449 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
5450 __Pyx_GOTREF(__pyx_t_1);
5451 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
5452 __Pyx_GOTREF(__pyx_t_2);
5453 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5454 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 330, __pyx_L1_error)
5455 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5465 __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error))
5466 __pyx_v_B_is_row_major = 1;
5485 __Pyx_TraceLine(332,0,__PYX_ERR(0, 332, __pyx_L1_error))
5486 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
5487 __Pyx_GOTREF(__pyx_t_2);
5488 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
5489 __Pyx_GOTREF(__pyx_t_1);
5490 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5491 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
5492 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5493 if (likely(__pyx_t_5)) {
5502 __Pyx_TraceLine(333,0,__PYX_ERR(0, 333, __pyx_L1_error))
5503 __pyx_v_B_is_row_major = 0;
5522 __Pyx_TraceLine(335,0,__PYX_ERR(0, 335, __pyx_L1_error))
5524 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
5525 __Pyx_GOTREF(__pyx_t_1);
5526 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5527 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5528 __PYX_ERR(0, 335, __pyx_L1_error)
5548 __Pyx_TraceLine(340,0,__PYX_ERR(0, 340, __pyx_L1_error))
5549 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 340, __pyx_L1_error)
5550 __pyx_v_B_data_mv_c = __pyx_t_6;
5551 __pyx_t_6.memview = NULL;
5552 __pyx_t_6.data = NULL;
5561 __Pyx_TraceLine(341,0,__PYX_ERR(0, 341, __pyx_L1_error))
5562 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 341, __pyx_L1_error)
5563 __pyx_v_B_data_mv_f = __pyx_t_7;
5564 __pyx_t_7.memview = NULL;
5565 __pyx_t_7.data = NULL;
5574 __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
5575 __pyx_v_B_data = NULL;
5584 __Pyx_TraceLine(348,0,__PYX_ERR(0, 348, __pyx_L1_error))
5585 __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
5595 __Pyx_TraceLine(351,0,__PYX_ERR(0, 351, __pyx_L1_error))
5596 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 351, __pyx_L1_error)
5597 __pyx_v_A_data_mv_c = __pyx_t_6;
5598 __pyx_t_6.memview = NULL;
5599 __pyx_t_6.data = NULL;
5608 __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error))
5611 __pyx_v_A_data = (&(*((
float *) ( ((
char *) (((
float *) ( (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
5630 __Pyx_TraceLine(359,0,__PYX_ERR(0, 359, __pyx_L1_error))
5632 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 359, __pyx_L1_error)
5633 __pyx_v_A_data_mv_f = __pyx_t_7;
5634 __pyx_t_7.memview = NULL;
5635 __pyx_t_7.data = NULL;
5644 __Pyx_TraceLine(362,0,__PYX_ERR(0, 362, __pyx_L1_error))
5647 __pyx_v_A_data = (&(*((
float *) ( (( ((
char *) (((
float *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
5658 __Pyx_TraceLine(365,0,__PYX_ERR(0, 365, __pyx_L1_error))
5659 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
5660 __pyx_t_4 = ((!__pyx_t_5) != 0);
5670 __Pyx_TraceLine(366,0,__PYX_ERR(0, 366, __pyx_L1_error))
5671 __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
5681 __Pyx_TraceLine(369,0,__PYX_ERR(0, 369, __pyx_L1_error))
5682 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 369, __pyx_L1_error)
5683 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
5684 __pyx_v_B_data_mv_c = __pyx_t_6;
5685 __pyx_t_6.memview = NULL;
5686 __pyx_t_6.data = NULL;
5695 __Pyx_TraceLine(372,0,__PYX_ERR(0, 372, __pyx_L1_error))
5698 __pyx_v_B_data = (&(*((
float *) ( ((
char *) (((
float *) ( (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
5717 __Pyx_TraceLine(377,0,__PYX_ERR(0, 377, __pyx_L1_error))
5719 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 377, __pyx_L1_error)
5720 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
5721 __pyx_v_B_data_mv_f = __pyx_t_7;
5722 __pyx_t_7.memview = NULL;
5723 __pyx_t_7.data = NULL;
5732 __Pyx_TraceLine(380,0,__PYX_ERR(0, 380, __pyx_L1_error))
5735 __pyx_v_B_data = (&(*((
float *) ( (( ((
char *) (((
float *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
5755 __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error))
5756 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
5766 __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
5770 __Pyx_CppExn2PyErr();
5771 __PYX_ERR(0, 384, __pyx_L1_error)
5773 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_10;
5792 __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5802 __Pyx_TraceLine(396,0,__PYX_ERR(0, 396, __pyx_L1_error))
5804 __pyx_t_10 =
new cDenseAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_is_row_major);
5806 __Pyx_CppExn2PyErr();
5807 __PYX_ERR(0, 390, __pyx_L1_error)
5817 __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5818 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_10;
5831 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5834 __Pyx_XDECREF(__pyx_t_1);
5835 __Pyx_XDECREF(__pyx_t_2);
5836 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5837 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
5838 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5841 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
5842 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
5843 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
5844 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
5845 __Pyx_XGIVEREF(__pyx_r);
5846 __Pyx_TraceReturn(__pyx_r, 0);
5847 __Pyx_RefNannyFinishContext();
5860 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5861 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double[] =
"pycAffineMatrixFunction.set_dense_matrix_double(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
5862 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double = {
"set_dense_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double};
5863 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5864 PyObject *__pyx_v_A = 0;
5865 PyObject *__pyx_v_B = 0;
5866 PyObject *__pyx_v_B_is_identity = 0;
5867 int __pyx_lineno = 0;
5868 const char *__pyx_filename = NULL;
5869 int __pyx_clineno = 0;
5870 PyObject *__pyx_r = 0;
5871 __Pyx_RefNannyDeclarations
5872 __Pyx_RefNannySetupContext(
"set_dense_matrix_double (wrapper)", 0);
5874 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
5875 PyObject* values[3] = {0,0,0};
5876 if (unlikely(__pyx_kwds)) {
5878 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5880 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5882 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5884 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5887 default:
goto __pyx_L5_argtuple_error;
5889 kw_args = PyDict_Size(__pyx_kwds);
5892 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5893 else goto __pyx_L5_argtuple_error;
5896 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
5898 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 402, __pyx_L3_error)
5902 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
5904 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 402, __pyx_L3_error)
5907 if (unlikely(kw_args > 0)) {
5908 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_dense_matrix_double") < 0)) __PYX_ERR(0, 402, __pyx_L3_error)
5910 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5911 goto __pyx_L5_argtuple_error;
5913 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5914 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5915 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5917 __pyx_v_A = values[0];
5918 __pyx_v_B = values[1];
5919 __pyx_v_B_is_identity = values[2];
5921 goto __pyx_L4_argument_unpacking_done;
5922 __pyx_L5_argtuple_error:;
5923 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 402, __pyx_L3_error)
5925 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5926 __Pyx_RefNannyFinishContext();
5928 __pyx_L4_argument_unpacking_done:;
5929 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
5932 __Pyx_RefNannyFinishContext();
5936 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
5939 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
5940 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
5941 __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5942 __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5943 __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5944 __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5945 double *__pyx_v_A_data;
5946 double *__pyx_v_B_data;
5947 PyObject *__pyx_r = NULL;
5948 __Pyx_TraceDeclarations
5949 __Pyx_RefNannyDeclarations
5950 PyObject *__pyx_t_1 = NULL;
5951 PyObject *__pyx_t_2 = NULL;
5955 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5956 __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5957 Py_ssize_t __pyx_t_8;
5958 Py_ssize_t __pyx_t_9;
5960 int __pyx_lineno = 0;
5961 const char *__pyx_filename = NULL;
5962 int __pyx_clineno = 0;
5963 __Pyx_TraceFrameInit(__pyx_codeobj__10)
5964 __Pyx_RefNannySetupContext(
"set_dense_matrix_double", 0);
5965 __Pyx_TraceCall(
"set_dense_matrix_double", __pyx_f[0], 402, 0, __PYX_ERR(0, 402, __pyx_L1_error));
5974 __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5975 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
5976 __Pyx_GOTREF(__pyx_t_1);
5977 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
5978 __Pyx_GOTREF(__pyx_t_2);
5979 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5980 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
5981 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5982 __pyx_v_A_num_rows = __pyx_t_3;
5991 __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error))
5992 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
5993 __Pyx_GOTREF(__pyx_t_2);
5994 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
5995 __Pyx_GOTREF(__pyx_t_1);
5996 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5997 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
5998 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5999 __pyx_v_A_num_columns = __pyx_t_3;
6008 __Pyx_TraceLine(416,0,__PYX_ERR(0, 416, __pyx_L1_error))
6009 __pyx_v_B_is_row_major = 0;
6018 __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error))
6019 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
6020 __Pyx_GOTREF(__pyx_t_1);
6021 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
6022 __Pyx_GOTREF(__pyx_t_2);
6023 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6024 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
6025 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6035 __Pyx_TraceLine(419,0,__PYX_ERR(0, 419, __pyx_L1_error))
6036 __pyx_v_A_is_row_major = 1;
6055 __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
6056 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
6057 __Pyx_GOTREF(__pyx_t_2);
6058 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
6059 __Pyx_GOTREF(__pyx_t_1);
6060 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6061 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
6062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6063 if (likely(__pyx_t_4)) {
6072 __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error))
6073 __pyx_v_A_is_row_major = 0;
6092 __Pyx_TraceLine(423,0,__PYX_ERR(0, 423, __pyx_L1_error))
6094 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
6095 __Pyx_GOTREF(__pyx_t_1);
6096 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6098 __PYX_ERR(0, 423, __pyx_L1_error)
6109 __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error))
6110 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 425, __pyx_L1_error)
6111 __pyx_t_5 = ((!__pyx_t_4) != 0);
6121 __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error))
6122 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
6123 __Pyx_GOTREF(__pyx_t_1);
6124 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
6125 __Pyx_GOTREF(__pyx_t_2);
6126 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6127 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
6128 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6138 __Pyx_TraceLine(427,0,__PYX_ERR(0, 427, __pyx_L1_error))
6139 __pyx_v_B_is_row_major = 1;
6158 __Pyx_TraceLine(428,0,__PYX_ERR(0, 428, __pyx_L1_error))
6159 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
6160 __Pyx_GOTREF(__pyx_t_2);
6161 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
6162 __Pyx_GOTREF(__pyx_t_1);
6163 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6164 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
6165 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6166 if (likely(__pyx_t_5)) {
6175 __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error))
6176 __pyx_v_B_is_row_major = 0;
6195 __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
6197 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
6198 __Pyx_GOTREF(__pyx_t_1);
6199 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6200 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6201 __PYX_ERR(0, 431, __pyx_L1_error)
6221 __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
6222 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 436, __pyx_L1_error)
6223 __pyx_v_B_data_mv_c = __pyx_t_6;
6224 __pyx_t_6.memview = NULL;
6225 __pyx_t_6.data = NULL;
6234 __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
6235 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 437, __pyx_L1_error)
6236 __pyx_v_B_data_mv_f = __pyx_t_7;
6237 __pyx_t_7.memview = NULL;
6238 __pyx_t_7.data = NULL;
6247 __Pyx_TraceLine(441,0,__PYX_ERR(0, 441, __pyx_L1_error))
6248 __pyx_v_B_data = NULL;
6257 __Pyx_TraceLine(444,0,__PYX_ERR(0, 444, __pyx_L1_error))
6258 __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
6268 __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
6269 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 447, __pyx_L1_error)
6270 __pyx_v_A_data_mv_c = __pyx_t_6;
6271 __pyx_t_6.memview = NULL;
6272 __pyx_t_6.data = NULL;
6281 __Pyx_TraceLine(450,0,__PYX_ERR(0, 450, __pyx_L1_error))
6284 __pyx_v_A_data = (&(*((
double *) ( ((
char *) (((
double *) ( (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6303 __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error))
6305 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 455, __pyx_L1_error)
6306 __pyx_v_A_data_mv_f = __pyx_t_7;
6307 __pyx_t_7.memview = NULL;
6308 __pyx_t_7.data = NULL;
6317 __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
6320 __pyx_v_A_data = (&(*((
double *) ( (( ((
char *) (((
double *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
6331 __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
6332 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
6333 __pyx_t_4 = ((!__pyx_t_5) != 0);
6343 __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error))
6344 __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
6354 __Pyx_TraceLine(465,0,__PYX_ERR(0, 465, __pyx_L1_error))
6355 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 465, __pyx_L1_error)
6356 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6357 __pyx_v_B_data_mv_c = __pyx_t_6;
6358 __pyx_t_6.memview = NULL;
6359 __pyx_t_6.data = NULL;
6368 __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error))
6371 __pyx_v_B_data = (&(*((
double *) ( ((
char *) (((
double *) ( (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6390 __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error))
6392 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 473, __pyx_L1_error)
6393 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6394 __pyx_v_B_data_mv_f = __pyx_t_7;
6395 __pyx_t_7.memview = NULL;
6396 __pyx_t_7.data = NULL;
6405 __Pyx_TraceLine(476,0,__PYX_ERR(0, 476, __pyx_L1_error))
6408 __pyx_v_B_data = (&(*((
double *) ( (( ((
char *) (((
double *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
6428 __Pyx_TraceLine(479,0,__PYX_ERR(0, 479, __pyx_L1_error))
6429 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 479, __pyx_L1_error)
6439 __Pyx_TraceLine(480,0,__PYX_ERR(0, 480, __pyx_L1_error))
6443 __Pyx_CppExn2PyErr();
6444 __PYX_ERR(0, 480, __pyx_L1_error)
6446 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_10;
6465 __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error))
6475 __Pyx_TraceLine(492,0,__PYX_ERR(0, 492, __pyx_L1_error))
6477 __pyx_t_10 =
new cDenseAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_is_row_major);
6479 __Pyx_CppExn2PyErr();
6480 __PYX_ERR(0, 486, __pyx_L1_error)
6490 __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error))
6491 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_10;
6504 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6507 __Pyx_XDECREF(__pyx_t_1);
6508 __Pyx_XDECREF(__pyx_t_2);
6509 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6510 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
6511 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6514 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
6515 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
6516 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6517 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6518 __Pyx_XGIVEREF(__pyx_r);
6519 __Pyx_TraceReturn(__pyx_r, 0);
6520 __Pyx_RefNannyFinishContext();
6533 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6534 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double[] =
"pycAffineMatrixFunction.set_dense_matrix_long_double(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
6535 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double = {
"set_dense_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double};
6536 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6537 PyObject *__pyx_v_A = 0;
6538 PyObject *__pyx_v_B = 0;
6539 PyObject *__pyx_v_B_is_identity = 0;
6540 int __pyx_lineno = 0;
6541 const char *__pyx_filename = NULL;
6542 int __pyx_clineno = 0;
6543 PyObject *__pyx_r = 0;
6544 __Pyx_RefNannyDeclarations
6545 __Pyx_RefNannySetupContext(
"set_dense_matrix_long_double (wrapper)", 0);
6547 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
6548 PyObject* values[3] = {0,0,0};
6549 if (unlikely(__pyx_kwds)) {
6551 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6553 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6555 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6557 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6560 default:
goto __pyx_L5_argtuple_error;
6562 kw_args = PyDict_Size(__pyx_kwds);
6565 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6566 else goto __pyx_L5_argtuple_error;
6569 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
6571 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 498, __pyx_L3_error)
6575 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
6577 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 498, __pyx_L3_error)
6580 if (unlikely(kw_args > 0)) {
6581 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_dense_matrix_long_double") < 0)) __PYX_ERR(0, 498, __pyx_L3_error)
6583 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6584 goto __pyx_L5_argtuple_error;
6586 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6587 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6588 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6590 __pyx_v_A = values[0];
6591 __pyx_v_B = values[1];
6592 __pyx_v_B_is_identity = values[2];
6594 goto __pyx_L4_argument_unpacking_done;
6595 __pyx_L5_argtuple_error:;
6596 __Pyx_RaiseArgtupleInvalid(
"set_dense_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 498, __pyx_L3_error)
6598 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6599 __Pyx_RefNannyFinishContext();
6601 __pyx_L4_argument_unpacking_done:;
6602 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
6605 __Pyx_RefNannyFinishContext();
6609 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
6612 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
6613 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
6614 __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
6615 __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
6616 __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
6617 __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
6618 long double *__pyx_v_A_data;
6619 long double *__pyx_v_B_data;
6620 PyObject *__pyx_r = NULL;
6621 __Pyx_TraceDeclarations
6622 __Pyx_RefNannyDeclarations
6623 PyObject *__pyx_t_1 = NULL;
6624 PyObject *__pyx_t_2 = NULL;
6628 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6629 __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
6630 Py_ssize_t __pyx_t_8;
6631 Py_ssize_t __pyx_t_9;
6633 int __pyx_lineno = 0;
6634 const char *__pyx_filename = NULL;
6635 int __pyx_clineno = 0;
6636 __Pyx_TraceFrameInit(__pyx_codeobj__11)
6637 __Pyx_RefNannySetupContext(
"set_dense_matrix_long_double", 0);
6638 __Pyx_TraceCall(
"set_dense_matrix_long_double", __pyx_f[0], 498, 0, __PYX_ERR(0, 498, __pyx_L1_error));
6647 __Pyx_TraceLine(507,0,__PYX_ERR(0, 507, __pyx_L1_error))
6648 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
6649 __Pyx_GOTREF(__pyx_t_1);
6650 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
6651 __Pyx_GOTREF(__pyx_t_2);
6652 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6653 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L1_error)
6654 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6655 __pyx_v_A_num_rows = __pyx_t_3;
6664 __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
6665 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
6666 __Pyx_GOTREF(__pyx_t_2);
6667 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
6668 __Pyx_GOTREF(__pyx_t_1);
6669 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6670 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L1_error)
6671 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6672 __pyx_v_A_num_columns = __pyx_t_3;
6681 __Pyx_TraceLine(512,0,__PYX_ERR(0, 512, __pyx_L1_error))
6682 __pyx_v_B_is_row_major = 0;
6691 __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error))
6692 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
6693 __Pyx_GOTREF(__pyx_t_1);
6694 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
6695 __Pyx_GOTREF(__pyx_t_2);
6696 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6697 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 514, __pyx_L1_error)
6698 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6708 __Pyx_TraceLine(515,0,__PYX_ERR(0, 515, __pyx_L1_error))
6709 __pyx_v_A_is_row_major = 1;
6728 __Pyx_TraceLine(516,0,__PYX_ERR(0, 516, __pyx_L1_error))
6729 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
6730 __Pyx_GOTREF(__pyx_t_2);
6731 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
6732 __Pyx_GOTREF(__pyx_t_1);
6733 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6734 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
6735 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6736 if (likely(__pyx_t_4)) {
6745 __Pyx_TraceLine(517,0,__PYX_ERR(0, 517, __pyx_L1_error))
6746 __pyx_v_A_is_row_major = 0;
6765 __Pyx_TraceLine(519,0,__PYX_ERR(0, 519, __pyx_L1_error))
6767 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error)
6768 __Pyx_GOTREF(__pyx_t_1);
6769 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6771 __PYX_ERR(0, 519, __pyx_L1_error)
6782 __Pyx_TraceLine(521,0,__PYX_ERR(0, 521, __pyx_L1_error))
6783 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
6784 __pyx_t_5 = ((!__pyx_t_4) != 0);
6794 __Pyx_TraceLine(522,0,__PYX_ERR(0, 522, __pyx_L1_error))
6795 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
6796 __Pyx_GOTREF(__pyx_t_1);
6797 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
6798 __Pyx_GOTREF(__pyx_t_2);
6799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6800 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 522, __pyx_L1_error)
6801 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6811 __Pyx_TraceLine(523,0,__PYX_ERR(0, 523, __pyx_L1_error))
6812 __pyx_v_B_is_row_major = 1;
6831 __Pyx_TraceLine(524,0,__PYX_ERR(0, 524, __pyx_L1_error))
6832 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
6833 __Pyx_GOTREF(__pyx_t_2);
6834 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
6835 __Pyx_GOTREF(__pyx_t_1);
6836 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6837 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
6838 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6839 if (likely(__pyx_t_5)) {
6848 __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
6849 __pyx_v_B_is_row_major = 0;
6868 __Pyx_TraceLine(527,0,__PYX_ERR(0, 527, __pyx_L1_error))
6870 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
6871 __Pyx_GOTREF(__pyx_t_1);
6872 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6874 __PYX_ERR(0, 527, __pyx_L1_error)
6894 __Pyx_TraceLine(532,0,__PYX_ERR(0, 532, __pyx_L1_error))
6895 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 532, __pyx_L1_error)
6896 __pyx_v_B_data_mv_c = __pyx_t_6;
6897 __pyx_t_6.memview = NULL;
6898 __pyx_t_6.data = NULL;
6907 __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error))
6908 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 533, __pyx_L1_error)
6909 __pyx_v_B_data_mv_f = __pyx_t_7;
6910 __pyx_t_7.memview = NULL;
6911 __pyx_t_7.data = NULL;
6920 __Pyx_TraceLine(537,0,__PYX_ERR(0, 537, __pyx_L1_error))
6921 __pyx_v_B_data = NULL;
6930 __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
6931 __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
6941 __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error))
6942 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 543, __pyx_L1_error)
6943 __pyx_v_A_data_mv_c = __pyx_t_6;
6944 __pyx_t_6.memview = NULL;
6945 __pyx_t_6.data = NULL;
6954 __Pyx_TraceLine(546,0,__PYX_ERR(0, 546, __pyx_L1_error))
6957 __pyx_v_A_data = (&(*((
long double *) ( ((
char *) (((
long double *) ( (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6976 __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
6978 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 551, __pyx_L1_error)
6979 __pyx_v_A_data_mv_f = __pyx_t_7;
6980 __pyx_t_7.memview = NULL;
6981 __pyx_t_7.data = NULL;
6990 __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error))
6993 __pyx_v_A_data = (&(*((
long double *) ( (( ((
char *) (((
long double *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
7004 __Pyx_TraceLine(557,0,__PYX_ERR(0, 557, __pyx_L1_error))
7005 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 557, __pyx_L1_error)
7006 __pyx_t_4 = ((!__pyx_t_5) != 0);
7016 __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
7017 __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
7027 __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
7028 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 561, __pyx_L1_error)
7029 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
7030 __pyx_v_B_data_mv_c = __pyx_t_6;
7031 __pyx_t_6.memview = NULL;
7032 __pyx_t_6.data = NULL;
7041 __Pyx_TraceLine(564,0,__PYX_ERR(0, 564, __pyx_L1_error))
7044 __pyx_v_B_data = (&(*((
long double *) ( ((
char *) (((
long double *) ( (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
7063 __Pyx_TraceLine(569,0,__PYX_ERR(0, 569, __pyx_L1_error))
7065 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_B, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 569, __pyx_L1_error)
7066 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
7067 __pyx_v_B_data_mv_f = __pyx_t_7;
7068 __pyx_t_7.memview = NULL;
7069 __pyx_t_7.data = NULL;
7078 __Pyx_TraceLine(572,0,__PYX_ERR(0, 572, __pyx_L1_error))
7081 __pyx_v_B_data = (&(*((
long double *) ( (( ((
char *) (((
long double *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
7101 __Pyx_TraceLine(575,0,__PYX_ERR(0, 575, __pyx_L1_error))
7102 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 575, __pyx_L1_error)
7112 __Pyx_TraceLine(576,0,__PYX_ERR(0, 576, __pyx_L1_error))
7116 __Pyx_CppExn2PyErr();
7117 __PYX_ERR(0, 576, __pyx_L1_error)
7119 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_10;
7138 __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error))
7148 __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
7152 __Pyx_CppExn2PyErr();
7153 __PYX_ERR(0, 582, __pyx_L1_error)
7163 __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error))
7164 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_10;
7177 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7180 __Pyx_XDECREF(__pyx_t_1);
7181 __Pyx_XDECREF(__pyx_t_2);
7182 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
7183 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
7184 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
7187 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
7188 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
7189 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
7190 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
7191 __Pyx_XGIVEREF(__pyx_r);
7192 __Pyx_TraceReturn(__pyx_r, 0);
7193 __Pyx_RefNannyFinishContext();
7206 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7207 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float[] =
"pycAffineMatrixFunction.set_csr_matrix_float(self, A, B, B_is_identity)\n\n ";
7208 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float = {
"set_csr_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float};
7209 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7210 PyObject *__pyx_v_A = 0;
7211 PyObject *__pyx_v_B = 0;
7212 PyObject *__pyx_v_B_is_identity = 0;
7213 int __pyx_lineno = 0;
7214 const char *__pyx_filename = NULL;
7215 int __pyx_clineno = 0;
7216 PyObject *__pyx_r = 0;
7217 __Pyx_RefNannyDeclarations
7218 __Pyx_RefNannySetupContext(
"set_csr_matrix_float (wrapper)", 0);
7220 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
7221 PyObject* values[3] = {0,0,0};
7222 if (unlikely(__pyx_kwds)) {
7224 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7226 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7228 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7230 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7233 default:
goto __pyx_L5_argtuple_error;
7235 kw_args = PyDict_Size(__pyx_kwds);
7238 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
7239 else goto __pyx_L5_argtuple_error;
7242 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
7244 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 594, __pyx_L3_error)
7248 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
7250 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 594, __pyx_L3_error)
7253 if (unlikely(kw_args > 0)) {
7254 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csr_matrix_float") < 0)) __PYX_ERR(0, 594, __pyx_L3_error)
7256 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
7257 goto __pyx_L5_argtuple_error;
7259 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7260 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7261 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7263 __pyx_v_A = values[0];
7264 __pyx_v_B = values[1];
7265 __pyx_v_B_is_identity = values[2];
7267 goto __pyx_L4_argument_unpacking_done;
7268 __pyx_L5_argtuple_error:;
7269 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 594, __pyx_L3_error)
7271 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
7272 __Pyx_RefNannyFinishContext();
7274 __pyx_L4_argument_unpacking_done:;
7275 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
7278 __Pyx_RefNannyFinishContext();
7282 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
7285 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7286 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7287 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7288 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7289 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7290 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7291 float *__pyx_v_A_data;
7294 float *__pyx_v_B_data;
7297 PyObject *__pyx_r = NULL;
7298 __Pyx_TraceDeclarations
7299 __Pyx_RefNannyDeclarations
7300 PyObject *__pyx_t_1 = NULL;
7301 PyObject *__pyx_t_2 = NULL;
7303 PyObject *__pyx_t_4 = NULL;
7304 PyObject *__pyx_t_5 = NULL;
7305 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
7306 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
7309 Py_ssize_t __pyx_t_10;
7311 int __pyx_lineno = 0;
7312 const char *__pyx_filename = NULL;
7313 int __pyx_clineno = 0;
7314 __Pyx_TraceFrameInit(__pyx_codeobj__12)
7315 __Pyx_RefNannySetupContext(
"set_csr_matrix_float", 0);
7316 __Pyx_TraceCall(
"set_csr_matrix_float", __pyx_f[0], 594, 0, __PYX_ERR(0, 594, __pyx_L1_error));
7325 __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error))
7326 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
7327 __Pyx_GOTREF(__pyx_t_1);
7328 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error)
7329 __Pyx_GOTREF(__pyx_t_2);
7330 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7331 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error)
7332 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7333 __pyx_v_A_num_rows = __pyx_t_3;
7342 __Pyx_TraceLine(600,0,__PYX_ERR(0, 600, __pyx_L1_error))
7343 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error)
7344 __Pyx_GOTREF(__pyx_t_2);
7345 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error)
7346 __Pyx_GOTREF(__pyx_t_1);
7347 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7348 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error)
7349 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7350 __pyx_v_A_num_columns = __pyx_t_3;
7359 __Pyx_TraceLine(604,0,__PYX_ERR(0, 604, __pyx_L1_error))
7360 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7361 __Pyx_GOTREF(__pyx_t_1);
7362 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
7363 __Pyx_GOTREF(__pyx_t_2);
7364 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7365 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7366 __Pyx_GOTREF(__pyx_t_1);
7367 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
7368 __Pyx_GOTREF(__pyx_t_4);
7369 __Pyx_GIVEREF(__pyx_t_1);
7370 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7372 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7373 __Pyx_GOTREF(__pyx_t_1);
7374 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
7375 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error)
7376 __Pyx_GOTREF(__pyx_t_5);
7377 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7378 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7379 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7388 __Pyx_TraceLine(603,0,__PYX_ERR(0, 603, __pyx_L1_error))
7389 __Pyx_GIVEREF(__pyx_t_5);
7390 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
7391 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
7392 __pyx_v_self->A_indices_copy = __pyx_t_5;
7402 __Pyx_TraceLine(606,0,__PYX_ERR(0, 606, __pyx_L1_error))
7403 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7404 __Pyx_GOTREF(__pyx_t_5);
7405 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
7406 __Pyx_GOTREF(__pyx_t_1);
7407 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7408 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7409 __Pyx_GOTREF(__pyx_t_5);
7410 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
7411 __Pyx_GOTREF(__pyx_t_4);
7412 __Pyx_GIVEREF(__pyx_t_5);
7413 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7415 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7416 __Pyx_GOTREF(__pyx_t_5);
7417 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
7418 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
7419 __Pyx_GOTREF(__pyx_t_2);
7420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7421 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7422 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7431 __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error))
7432 __Pyx_GIVEREF(__pyx_t_2);
7433 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
7434 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
7435 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
7445 __Pyx_TraceLine(609,0,__PYX_ERR(0, 609, __pyx_L1_error))
7446 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error)
7447 __Pyx_GOTREF(__pyx_t_2);
7448 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 609, __pyx_L1_error)
7449 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7450 __pyx_v_A_data_mv = __pyx_t_6;
7451 __pyx_t_6.memview = NULL;
7452 __pyx_t_6.data = NULL;
7461 __Pyx_TraceLine(610,0,__PYX_ERR(0, 610, __pyx_L1_error))
7462 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 610, __pyx_L1_error)
7463 __pyx_v_A_indices_mv = __pyx_t_7;
7464 __pyx_t_7.memview = NULL;
7465 __pyx_t_7.data = NULL;
7474 __Pyx_TraceLine(612,0,__PYX_ERR(0, 612, __pyx_L1_error))
7475 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 612, __pyx_L1_error)
7476 __pyx_v_A_index_pointer_mv = __pyx_t_7;
7477 __pyx_t_7.memview = NULL;
7478 __pyx_t_7.data = NULL;
7487 __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error))
7488 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 613, __pyx_L1_error)
7489 __pyx_v_B_data_mv = __pyx_t_6;
7490 __pyx_t_6.memview = NULL;
7491 __pyx_t_6.data = NULL;
7500 __Pyx_TraceLine(614,0,__PYX_ERR(0, 614, __pyx_L1_error))
7501 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 614, __pyx_L1_error)
7502 __pyx_v_B_indices_mv = __pyx_t_7;
7503 __pyx_t_7.memview = NULL;
7504 __pyx_t_7.data = NULL;
7513 __Pyx_TraceLine(615,0,__PYX_ERR(0, 615, __pyx_L1_error))
7514 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 615, __pyx_L1_error)
7515 __pyx_v_B_index_pointer_mv = __pyx_t_7;
7516 __pyx_t_7.memview = NULL;
7517 __pyx_t_7.data = NULL;
7526 __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error))
7527 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
7528 __pyx_t_9 = ((!__pyx_t_8) != 0);
7538 __Pyx_TraceLine(621,0,__PYX_ERR(0, 621, __pyx_L1_error))
7539 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7540 __Pyx_GOTREF(__pyx_t_2);
7541 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 621, __pyx_L1_error)
7542 __Pyx_GOTREF(__pyx_t_5);
7543 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7544 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7545 __Pyx_GOTREF(__pyx_t_2);
7546 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error)
7547 __Pyx_GOTREF(__pyx_t_4);
7548 __Pyx_GIVEREF(__pyx_t_2);
7549 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
7551 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7552 __Pyx_GOTREF(__pyx_t_2);
7553 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
7554 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
7555 __Pyx_GOTREF(__pyx_t_1);
7556 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7557 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7558 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7567 __Pyx_TraceLine(620,0,__PYX_ERR(0, 620, __pyx_L1_error))
7568 __Pyx_GIVEREF(__pyx_t_1);
7569 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
7570 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
7571 __pyx_v_self->B_indices_copy = __pyx_t_1;
7581 __Pyx_TraceLine(623,0,__PYX_ERR(0, 623, __pyx_L1_error))
7582 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7583 __Pyx_GOTREF(__pyx_t_1);
7584 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
7585 __Pyx_GOTREF(__pyx_t_2);
7586 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7587 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7588 __Pyx_GOTREF(__pyx_t_1);
7589 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
7590 __Pyx_GOTREF(__pyx_t_4);
7591 __Pyx_GIVEREF(__pyx_t_1);
7592 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7594 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7595 __Pyx_GOTREF(__pyx_t_1);
7596 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
7597 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
7598 __Pyx_GOTREF(__pyx_t_5);
7599 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7600 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7601 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7610 __Pyx_TraceLine(622,0,__PYX_ERR(0, 622, __pyx_L1_error))
7611 __Pyx_GIVEREF(__pyx_t_5);
7612 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
7613 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
7614 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
7624 __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error))
7625 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error)
7626 __Pyx_GOTREF(__pyx_t_5);
7627 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 625, __pyx_L1_error)
7628 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7629 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
7630 __pyx_v_B_data_mv = __pyx_t_6;
7631 __pyx_t_6.memview = NULL;
7632 __pyx_t_6.data = NULL;
7641 __Pyx_TraceLine(626,0,__PYX_ERR(0, 626, __pyx_L1_error))
7642 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 626, __pyx_L1_error)
7643 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
7644 __pyx_v_B_indices_mv = __pyx_t_7;
7645 __pyx_t_7.memview = NULL;
7646 __pyx_t_7.data = NULL;
7655 __Pyx_TraceLine(627,0,__PYX_ERR(0, 627, __pyx_L1_error))
7656 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 627, __pyx_L1_error)
7657 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
7658 __pyx_v_B_index_pointer_mv = __pyx_t_7;
7659 __pyx_t_7.memview = NULL;
7660 __pyx_t_7.data = NULL;
7678 __Pyx_TraceLine(630,0,__PYX_ERR(0, 630, __pyx_L1_error))
7680 __pyx_v_A_data = (&(*((
float *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
7689 __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error))
7691 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
7700 __Pyx_TraceLine(632,0,__PYX_ERR(0, 632, __pyx_L1_error))
7702 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
7711 __Pyx_TraceLine(633,0,__PYX_ERR(0, 633, __pyx_L1_error))
7712 __pyx_v_B_data = NULL;
7721 __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
7722 __pyx_v_B_indices = NULL;
7731 __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
7732 __pyx_v_B_index_pointer = NULL;
7741 __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error))
7742 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 637, __pyx_L1_error)
7743 __pyx_t_8 = ((!__pyx_t_9) != 0);
7753 __Pyx_TraceLine(638,0,__PYX_ERR(0, 638, __pyx_L1_error))
7755 __pyx_v_B_data = (&(*((
float *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
7764 __Pyx_TraceLine(639,0,__PYX_ERR(0, 639, __pyx_L1_error))
7766 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
7775 __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error))
7777 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
7795 __Pyx_TraceLine(643,0,__PYX_ERR(0, 643, __pyx_L1_error))
7796 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
7806 __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error))
7808 __pyx_t_11 =
new cCSRAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
7810 __Pyx_CppExn2PyErr();
7811 __PYX_ERR(0, 644, __pyx_L1_error)
7813 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
7832 __Pyx_TraceLine(651,0,__PYX_ERR(0, 651, __pyx_L1_error))
7842 __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error))
7844 __pyx_t_11 =
new cCSRAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
7846 __Pyx_CppExn2PyErr();
7847 __PYX_ERR(0, 651, __pyx_L1_error)
7857 __Pyx_TraceLine(651,0,__PYX_ERR(0, 651, __pyx_L1_error))
7858 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
7871 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7874 __Pyx_XDECREF(__pyx_t_1);
7875 __Pyx_XDECREF(__pyx_t_2);
7876 __Pyx_XDECREF(__pyx_t_4);
7877 __Pyx_XDECREF(__pyx_t_5);
7878 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
7879 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
7880 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
7883 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
7884 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
7885 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
7886 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
7887 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
7888 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
7889 __Pyx_XGIVEREF(__pyx_r);
7890 __Pyx_TraceReturn(__pyx_r, 0);
7891 __Pyx_RefNannyFinishContext();
7904 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7905 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double[] =
"pycAffineMatrixFunction.set_csr_matrix_double(self, A, B, B_is_identity)\n\n ";
7906 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double = {
"set_csr_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double};
7907 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7908 PyObject *__pyx_v_A = 0;
7909 PyObject *__pyx_v_B = 0;
7910 PyObject *__pyx_v_B_is_identity = 0;
7911 int __pyx_lineno = 0;
7912 const char *__pyx_filename = NULL;
7913 int __pyx_clineno = 0;
7914 PyObject *__pyx_r = 0;
7915 __Pyx_RefNannyDeclarations
7916 __Pyx_RefNannySetupContext(
"set_csr_matrix_double (wrapper)", 0);
7918 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
7919 PyObject* values[3] = {0,0,0};
7920 if (unlikely(__pyx_kwds)) {
7922 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7924 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7926 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7928 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7931 default:
goto __pyx_L5_argtuple_error;
7933 kw_args = PyDict_Size(__pyx_kwds);
7936 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
7937 else goto __pyx_L5_argtuple_error;
7940 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
7942 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 665, __pyx_L3_error)
7946 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
7948 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 665, __pyx_L3_error)
7951 if (unlikely(kw_args > 0)) {
7952 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csr_matrix_double") < 0)) __PYX_ERR(0, 665, __pyx_L3_error)
7954 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
7955 goto __pyx_L5_argtuple_error;
7957 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7958 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7959 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7961 __pyx_v_A = values[0];
7962 __pyx_v_B = values[1];
7963 __pyx_v_B_is_identity = values[2];
7965 goto __pyx_L4_argument_unpacking_done;
7966 __pyx_L5_argtuple_error:;
7967 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 665, __pyx_L3_error)
7969 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
7970 __Pyx_RefNannyFinishContext();
7972 __pyx_L4_argument_unpacking_done:;
7973 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
7976 __Pyx_RefNannyFinishContext();
7980 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
7983 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7984 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7985 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7986 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7987 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7988 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7989 double *__pyx_v_A_data;
7992 double *__pyx_v_B_data;
7995 PyObject *__pyx_r = NULL;
7996 __Pyx_TraceDeclarations
7997 __Pyx_RefNannyDeclarations
7998 PyObject *__pyx_t_1 = NULL;
7999 PyObject *__pyx_t_2 = NULL;
8001 PyObject *__pyx_t_4 = NULL;
8002 PyObject *__pyx_t_5 = NULL;
8003 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
8004 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
8007 Py_ssize_t __pyx_t_10;
8009 int __pyx_lineno = 0;
8010 const char *__pyx_filename = NULL;
8011 int __pyx_clineno = 0;
8012 __Pyx_TraceFrameInit(__pyx_codeobj__13)
8013 __Pyx_RefNannySetupContext(
"set_csr_matrix_double", 0);
8014 __Pyx_TraceCall(
"set_csr_matrix_double", __pyx_f[0], 665, 0, __PYX_ERR(0, 665, __pyx_L1_error));
8023 __Pyx_TraceLine(670,0,__PYX_ERR(0, 670, __pyx_L1_error))
8024 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
8025 __Pyx_GOTREF(__pyx_t_1);
8026 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
8027 __Pyx_GOTREF(__pyx_t_2);
8028 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8029 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error)
8030 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8031 __pyx_v_A_num_rows = __pyx_t_3;
8040 __Pyx_TraceLine(671,0,__PYX_ERR(0, 671, __pyx_L1_error))
8041 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
8042 __Pyx_GOTREF(__pyx_t_2);
8043 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
8044 __Pyx_GOTREF(__pyx_t_1);
8045 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8046 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L1_error)
8047 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8048 __pyx_v_A_num_columns = __pyx_t_3;
8057 __Pyx_TraceLine(675,0,__PYX_ERR(0, 675, __pyx_L1_error))
8058 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
8059 __Pyx_GOTREF(__pyx_t_1);
8060 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
8061 __Pyx_GOTREF(__pyx_t_2);
8062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8063 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
8064 __Pyx_GOTREF(__pyx_t_1);
8065 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error)
8066 __Pyx_GOTREF(__pyx_t_4);
8067 __Pyx_GIVEREF(__pyx_t_1);
8068 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8070 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
8071 __Pyx_GOTREF(__pyx_t_1);
8072 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
8073 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error)
8074 __Pyx_GOTREF(__pyx_t_5);
8075 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8076 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8077 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8086 __Pyx_TraceLine(674,0,__PYX_ERR(0, 674, __pyx_L1_error))
8087 __Pyx_GIVEREF(__pyx_t_5);
8088 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
8089 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
8090 __pyx_v_self->A_indices_copy = __pyx_t_5;
8100 __Pyx_TraceLine(677,0,__PYX_ERR(0, 677, __pyx_L1_error))
8101 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
8102 __Pyx_GOTREF(__pyx_t_5);
8103 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
8104 __Pyx_GOTREF(__pyx_t_1);
8105 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8106 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
8107 __Pyx_GOTREF(__pyx_t_5);
8108 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
8109 __Pyx_GOTREF(__pyx_t_4);
8110 __Pyx_GIVEREF(__pyx_t_5);
8111 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8113 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
8114 __Pyx_GOTREF(__pyx_t_5);
8115 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 677, __pyx_L1_error)
8116 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
8117 __Pyx_GOTREF(__pyx_t_2);
8118 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8119 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8120 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8129 __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L1_error))
8130 __Pyx_GIVEREF(__pyx_t_2);
8131 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
8132 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
8133 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
8143 __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L1_error))
8144 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
8145 __Pyx_GOTREF(__pyx_t_2);
8146 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 680, __pyx_L1_error)
8147 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8148 __pyx_v_A_data_mv = __pyx_t_6;
8149 __pyx_t_6.memview = NULL;
8150 __pyx_t_6.data = NULL;
8159 __Pyx_TraceLine(681,0,__PYX_ERR(0, 681, __pyx_L1_error))
8160 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 681, __pyx_L1_error)
8161 __pyx_v_A_indices_mv = __pyx_t_7;
8162 __pyx_t_7.memview = NULL;
8163 __pyx_t_7.data = NULL;
8172 __Pyx_TraceLine(683,0,__PYX_ERR(0, 683, __pyx_L1_error))
8173 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 683, __pyx_L1_error)
8174 __pyx_v_A_index_pointer_mv = __pyx_t_7;
8175 __pyx_t_7.memview = NULL;
8176 __pyx_t_7.data = NULL;
8185 __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L1_error))
8186 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 684, __pyx_L1_error)
8187 __pyx_v_B_data_mv = __pyx_t_6;
8188 __pyx_t_6.memview = NULL;
8189 __pyx_t_6.data = NULL;
8198 __Pyx_TraceLine(685,0,__PYX_ERR(0, 685, __pyx_L1_error))
8199 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 685, __pyx_L1_error)
8200 __pyx_v_B_indices_mv = __pyx_t_7;
8201 __pyx_t_7.memview = NULL;
8202 __pyx_t_7.data = NULL;
8211 __Pyx_TraceLine(686,0,__PYX_ERR(0, 686, __pyx_L1_error))
8212 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
8213 __pyx_v_B_index_pointer_mv = __pyx_t_7;
8214 __pyx_t_7.memview = NULL;
8215 __pyx_t_7.data = NULL;
8224 __Pyx_TraceLine(688,0,__PYX_ERR(0, 688, __pyx_L1_error))
8225 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 688, __pyx_L1_error)
8226 __pyx_t_9 = ((!__pyx_t_8) != 0);
8236 __Pyx_TraceLine(692,0,__PYX_ERR(0, 692, __pyx_L1_error))
8237 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8238 __Pyx_GOTREF(__pyx_t_2);
8239 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error)
8240 __Pyx_GOTREF(__pyx_t_5);
8241 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8242 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8243 __Pyx_GOTREF(__pyx_t_2);
8244 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
8245 __Pyx_GOTREF(__pyx_t_4);
8246 __Pyx_GIVEREF(__pyx_t_2);
8247 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
8249 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8250 __Pyx_GOTREF(__pyx_t_2);
8251 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
8252 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
8253 __Pyx_GOTREF(__pyx_t_1);
8254 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8255 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8256 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8265 __Pyx_TraceLine(691,0,__PYX_ERR(0, 691, __pyx_L1_error))
8266 __Pyx_GIVEREF(__pyx_t_1);
8267 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
8268 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
8269 __pyx_v_self->B_indices_copy = __pyx_t_1;
8279 __Pyx_TraceLine(694,0,__PYX_ERR(0, 694, __pyx_L1_error))
8280 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8281 __Pyx_GOTREF(__pyx_t_1);
8282 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
8283 __Pyx_GOTREF(__pyx_t_2);
8284 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8285 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8286 __Pyx_GOTREF(__pyx_t_1);
8287 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
8288 __Pyx_GOTREF(__pyx_t_4);
8289 __Pyx_GIVEREF(__pyx_t_1);
8290 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8292 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8293 __Pyx_GOTREF(__pyx_t_1);
8294 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 694, __pyx_L1_error)
8295 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
8296 __Pyx_GOTREF(__pyx_t_5);
8297 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8298 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8299 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8308 __Pyx_TraceLine(693,0,__PYX_ERR(0, 693, __pyx_L1_error))
8309 __Pyx_GIVEREF(__pyx_t_5);
8310 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
8311 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
8312 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
8322 __Pyx_TraceLine(696,0,__PYX_ERR(0, 696, __pyx_L1_error))
8323 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
8324 __Pyx_GOTREF(__pyx_t_5);
8325 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 696, __pyx_L1_error)
8326 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8327 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
8328 __pyx_v_B_data_mv = __pyx_t_6;
8329 __pyx_t_6.memview = NULL;
8330 __pyx_t_6.data = NULL;
8339 __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L1_error))
8340 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 697, __pyx_L1_error)
8341 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
8342 __pyx_v_B_indices_mv = __pyx_t_7;
8343 __pyx_t_7.memview = NULL;
8344 __pyx_t_7.data = NULL;
8353 __Pyx_TraceLine(698,0,__PYX_ERR(0, 698, __pyx_L1_error))
8354 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 698, __pyx_L1_error)
8355 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
8356 __pyx_v_B_index_pointer_mv = __pyx_t_7;
8357 __pyx_t_7.memview = NULL;
8358 __pyx_t_7.data = NULL;
8376 __Pyx_TraceLine(701,0,__PYX_ERR(0, 701, __pyx_L1_error))
8378 __pyx_v_A_data = (&(*((
double *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
8387 __Pyx_TraceLine(702,0,__PYX_ERR(0, 702, __pyx_L1_error))
8389 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
8398 __Pyx_TraceLine(703,0,__PYX_ERR(0, 703, __pyx_L1_error))
8400 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
8409 __Pyx_TraceLine(704,0,__PYX_ERR(0, 704, __pyx_L1_error))
8410 __pyx_v_B_data = NULL;
8419 __Pyx_TraceLine(705,0,__PYX_ERR(0, 705, __pyx_L1_error))
8420 __pyx_v_B_indices = NULL;
8429 __Pyx_TraceLine(706,0,__PYX_ERR(0, 706, __pyx_L1_error))
8430 __pyx_v_B_index_pointer = NULL;
8439 __Pyx_TraceLine(708,0,__PYX_ERR(0, 708, __pyx_L1_error))
8440 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 708, __pyx_L1_error)
8441 __pyx_t_8 = ((!__pyx_t_9) != 0);
8451 __Pyx_TraceLine(709,0,__PYX_ERR(0, 709, __pyx_L1_error))
8453 __pyx_v_B_data = (&(*((
double *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
8462 __Pyx_TraceLine(710,0,__PYX_ERR(0, 710, __pyx_L1_error))
8464 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
8473 __Pyx_TraceLine(711,0,__PYX_ERR(0, 711, __pyx_L1_error))
8475 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
8493 __Pyx_TraceLine(714,0,__PYX_ERR(0, 714, __pyx_L1_error))
8494 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
8504 __Pyx_TraceLine(715,0,__PYX_ERR(0, 715, __pyx_L1_error))
8508 __Pyx_CppExn2PyErr();
8509 __PYX_ERR(0, 715, __pyx_L1_error)
8511 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
8530 __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error))
8540 __Pyx_TraceLine(730,0,__PYX_ERR(0, 730, __pyx_L1_error))
8542 __pyx_t_11 =
new cCSRAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
8544 __Pyx_CppExn2PyErr();
8545 __PYX_ERR(0, 722, __pyx_L1_error)
8555 __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error))
8556 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
8569 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8572 __Pyx_XDECREF(__pyx_t_1);
8573 __Pyx_XDECREF(__pyx_t_2);
8574 __Pyx_XDECREF(__pyx_t_4);
8575 __Pyx_XDECREF(__pyx_t_5);
8576 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
8577 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
8578 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
8581 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
8582 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
8583 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
8584 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
8585 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
8586 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
8587 __Pyx_XGIVEREF(__pyx_r);
8588 __Pyx_TraceReturn(__pyx_r, 0);
8589 __Pyx_RefNannyFinishContext();
8602 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8603 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double[] =
"pycAffineMatrixFunction.set_csr_matrix_long_double(self, A, B, B_is_identity)\n\n ";
8604 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double = {
"set_csr_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double};
8605 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8606 PyObject *__pyx_v_A = 0;
8607 PyObject *__pyx_v_B = 0;
8608 PyObject *__pyx_v_B_is_identity = 0;
8609 int __pyx_lineno = 0;
8610 const char *__pyx_filename = NULL;
8611 int __pyx_clineno = 0;
8612 PyObject *__pyx_r = 0;
8613 __Pyx_RefNannyDeclarations
8614 __Pyx_RefNannySetupContext(
"set_csr_matrix_long_double (wrapper)", 0);
8616 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
8617 PyObject* values[3] = {0,0,0};
8618 if (unlikely(__pyx_kwds)) {
8620 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8622 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8624 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8626 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8629 default:
goto __pyx_L5_argtuple_error;
8631 kw_args = PyDict_Size(__pyx_kwds);
8634 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
8635 else goto __pyx_L5_argtuple_error;
8638 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
8640 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 736, __pyx_L3_error)
8644 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
8646 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 736, __pyx_L3_error)
8649 if (unlikely(kw_args > 0)) {
8650 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csr_matrix_long_double") < 0)) __PYX_ERR(0, 736, __pyx_L3_error)
8652 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
8653 goto __pyx_L5_argtuple_error;
8655 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8656 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8657 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8659 __pyx_v_A = values[0];
8660 __pyx_v_B = values[1];
8661 __pyx_v_B_is_identity = values[2];
8663 goto __pyx_L4_argument_unpacking_done;
8664 __pyx_L5_argtuple_error:;
8665 __Pyx_RaiseArgtupleInvalid(
"set_csr_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 736, __pyx_L3_error)
8667 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
8668 __Pyx_RefNannyFinishContext();
8670 __pyx_L4_argument_unpacking_done:;
8671 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
8674 __Pyx_RefNannyFinishContext();
8678 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
8681 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8682 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8683 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8684 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8685 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8686 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8687 long double *__pyx_v_A_data;
8690 long double *__pyx_v_B_data;
8693 PyObject *__pyx_r = NULL;
8694 __Pyx_TraceDeclarations
8695 __Pyx_RefNannyDeclarations
8696 PyObject *__pyx_t_1 = NULL;
8697 PyObject *__pyx_t_2 = NULL;
8699 PyObject *__pyx_t_4 = NULL;
8700 PyObject *__pyx_t_5 = NULL;
8701 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
8702 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
8705 Py_ssize_t __pyx_t_10;
8707 int __pyx_lineno = 0;
8708 const char *__pyx_filename = NULL;
8709 int __pyx_clineno = 0;
8710 __Pyx_TraceFrameInit(__pyx_codeobj__14)
8711 __Pyx_RefNannySetupContext(
"set_csr_matrix_long_double", 0);
8712 __Pyx_TraceCall(
"set_csr_matrix_long_double", __pyx_f[0], 736, 0, __PYX_ERR(0, 736, __pyx_L1_error));
8721 __Pyx_TraceLine(741,0,__PYX_ERR(0, 741, __pyx_L1_error))
8722 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
8723 __Pyx_GOTREF(__pyx_t_1);
8724 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
8725 __Pyx_GOTREF(__pyx_t_2);
8726 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8727 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 741, __pyx_L1_error)
8728 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8729 __pyx_v_A_num_rows = __pyx_t_3;
8738 __Pyx_TraceLine(742,0,__PYX_ERR(0, 742, __pyx_L1_error))
8739 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
8740 __Pyx_GOTREF(__pyx_t_2);
8741 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
8742 __Pyx_GOTREF(__pyx_t_1);
8743 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8744 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 742, __pyx_L1_error)
8745 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8746 __pyx_v_A_num_columns = __pyx_t_3;
8755 __Pyx_TraceLine(746,0,__PYX_ERR(0, 746, __pyx_L1_error))
8756 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8757 __Pyx_GOTREF(__pyx_t_1);
8758 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
8759 __Pyx_GOTREF(__pyx_t_2);
8760 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8761 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8762 __Pyx_GOTREF(__pyx_t_1);
8763 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error)
8764 __Pyx_GOTREF(__pyx_t_4);
8765 __Pyx_GIVEREF(__pyx_t_1);
8766 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8768 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8769 __Pyx_GOTREF(__pyx_t_1);
8770 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
8771 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
8772 __Pyx_GOTREF(__pyx_t_5);
8773 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8774 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8775 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8784 __Pyx_TraceLine(745,0,__PYX_ERR(0, 745, __pyx_L1_error))
8785 __Pyx_GIVEREF(__pyx_t_5);
8786 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
8787 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
8788 __pyx_v_self->A_indices_copy = __pyx_t_5;
8798 __Pyx_TraceLine(748,0,__PYX_ERR(0, 748, __pyx_L1_error))
8799 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8800 __Pyx_GOTREF(__pyx_t_5);
8801 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
8802 __Pyx_GOTREF(__pyx_t_1);
8803 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8804 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8805 __Pyx_GOTREF(__pyx_t_5);
8806 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error)
8807 __Pyx_GOTREF(__pyx_t_4);
8808 __Pyx_GIVEREF(__pyx_t_5);
8809 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8811 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8812 __Pyx_GOTREF(__pyx_t_5);
8813 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
8814 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
8815 __Pyx_GOTREF(__pyx_t_2);
8816 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8817 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8818 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8827 __Pyx_TraceLine(747,0,__PYX_ERR(0, 747, __pyx_L1_error))
8828 __Pyx_GIVEREF(__pyx_t_2);
8829 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
8830 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
8831 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
8841 __Pyx_TraceLine(751,0,__PYX_ERR(0, 751, __pyx_L1_error))
8842 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
8843 __Pyx_GOTREF(__pyx_t_2);
8844 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 751, __pyx_L1_error)
8845 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8846 __pyx_v_A_data_mv = __pyx_t_6;
8847 __pyx_t_6.memview = NULL;
8848 __pyx_t_6.data = NULL;
8857 __Pyx_TraceLine(752,0,__PYX_ERR(0, 752, __pyx_L1_error))
8858 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 752, __pyx_L1_error)
8859 __pyx_v_A_indices_mv = __pyx_t_7;
8860 __pyx_t_7.memview = NULL;
8861 __pyx_t_7.data = NULL;
8870 __Pyx_TraceLine(754,0,__PYX_ERR(0, 754, __pyx_L1_error))
8871 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 754, __pyx_L1_error)
8872 __pyx_v_A_index_pointer_mv = __pyx_t_7;
8873 __pyx_t_7.memview = NULL;
8874 __pyx_t_7.data = NULL;
8883 __Pyx_TraceLine(755,0,__PYX_ERR(0, 755, __pyx_L1_error))
8884 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 755, __pyx_L1_error)
8885 __pyx_v_B_data_mv = __pyx_t_6;
8886 __pyx_t_6.memview = NULL;
8887 __pyx_t_6.data = NULL;
8896 __Pyx_TraceLine(756,0,__PYX_ERR(0, 756, __pyx_L1_error))
8897 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 756, __pyx_L1_error)
8898 __pyx_v_B_indices_mv = __pyx_t_7;
8899 __pyx_t_7.memview = NULL;
8900 __pyx_t_7.data = NULL;
8909 __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L1_error))
8910 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 757, __pyx_L1_error)
8911 __pyx_v_B_index_pointer_mv = __pyx_t_7;
8912 __pyx_t_7.memview = NULL;
8913 __pyx_t_7.data = NULL;
8922 __Pyx_TraceLine(759,0,__PYX_ERR(0, 759, __pyx_L1_error))
8923 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 759, __pyx_L1_error)
8924 __pyx_t_9 = ((!__pyx_t_8) != 0);
8934 __Pyx_TraceLine(763,0,__PYX_ERR(0, 763, __pyx_L1_error))
8935 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8936 __Pyx_GOTREF(__pyx_t_2);
8937 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
8938 __Pyx_GOTREF(__pyx_t_5);
8939 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8940 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8941 __Pyx_GOTREF(__pyx_t_2);
8942 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
8943 __Pyx_GOTREF(__pyx_t_4);
8944 __Pyx_GIVEREF(__pyx_t_2);
8945 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
8947 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8948 __Pyx_GOTREF(__pyx_t_2);
8949 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 763, __pyx_L1_error)
8950 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error)
8951 __Pyx_GOTREF(__pyx_t_1);
8952 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8953 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8954 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8963 __Pyx_TraceLine(762,0,__PYX_ERR(0, 762, __pyx_L1_error))
8964 __Pyx_GIVEREF(__pyx_t_1);
8965 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
8966 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
8967 __pyx_v_self->B_indices_copy = __pyx_t_1;
8977 __Pyx_TraceLine(765,0,__PYX_ERR(0, 765, __pyx_L1_error))
8978 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8979 __Pyx_GOTREF(__pyx_t_1);
8980 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
8981 __Pyx_GOTREF(__pyx_t_2);
8982 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8983 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8984 __Pyx_GOTREF(__pyx_t_1);
8985 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
8986 __Pyx_GOTREF(__pyx_t_4);
8987 __Pyx_GIVEREF(__pyx_t_1);
8988 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8990 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8991 __Pyx_GOTREF(__pyx_t_1);
8992 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
8993 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 765, __pyx_L1_error)
8994 __Pyx_GOTREF(__pyx_t_5);
8995 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8996 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8997 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9006 __Pyx_TraceLine(764,0,__PYX_ERR(0, 764, __pyx_L1_error))
9007 __Pyx_GIVEREF(__pyx_t_5);
9008 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
9009 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
9010 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
9020 __Pyx_TraceLine(767,0,__PYX_ERR(0, 767, __pyx_L1_error))
9021 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
9022 __Pyx_GOTREF(__pyx_t_5);
9023 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 767, __pyx_L1_error)
9024 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9025 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9026 __pyx_v_B_data_mv = __pyx_t_6;
9027 __pyx_t_6.memview = NULL;
9028 __pyx_t_6.data = NULL;
9037 __Pyx_TraceLine(768,0,__PYX_ERR(0, 768, __pyx_L1_error))
9038 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 768, __pyx_L1_error)
9039 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9040 __pyx_v_B_indices_mv = __pyx_t_7;
9041 __pyx_t_7.memview = NULL;
9042 __pyx_t_7.data = NULL;
9051 __Pyx_TraceLine(769,0,__PYX_ERR(0, 769, __pyx_L1_error))
9052 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 769, __pyx_L1_error)
9053 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9054 __pyx_v_B_index_pointer_mv = __pyx_t_7;
9055 __pyx_t_7.memview = NULL;
9056 __pyx_t_7.data = NULL;
9074 __Pyx_TraceLine(772,0,__PYX_ERR(0, 772, __pyx_L1_error))
9076 __pyx_v_A_data = (&(*((
long double *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
9085 __Pyx_TraceLine(773,0,__PYX_ERR(0, 773, __pyx_L1_error))
9087 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
9096 __Pyx_TraceLine(774,0,__PYX_ERR(0, 774, __pyx_L1_error))
9098 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
9107 __Pyx_TraceLine(775,0,__PYX_ERR(0, 775, __pyx_L1_error))
9108 __pyx_v_B_data = NULL;
9117 __Pyx_TraceLine(776,0,__PYX_ERR(0, 776, __pyx_L1_error))
9118 __pyx_v_B_indices = NULL;
9127 __Pyx_TraceLine(777,0,__PYX_ERR(0, 777, __pyx_L1_error))
9128 __pyx_v_B_index_pointer = NULL;
9137 __Pyx_TraceLine(779,0,__PYX_ERR(0, 779, __pyx_L1_error))
9138 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 779, __pyx_L1_error)
9139 __pyx_t_8 = ((!__pyx_t_9) != 0);
9149 __Pyx_TraceLine(780,0,__PYX_ERR(0, 780, __pyx_L1_error))
9151 __pyx_v_B_data = (&(*((
long double *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
9160 __Pyx_TraceLine(781,0,__PYX_ERR(0, 781, __pyx_L1_error))
9162 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
9171 __Pyx_TraceLine(782,0,__PYX_ERR(0, 782, __pyx_L1_error))
9173 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
9191 __Pyx_TraceLine(785,0,__PYX_ERR(0, 785, __pyx_L1_error))
9192 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 785, __pyx_L1_error)
9202 __Pyx_TraceLine(786,0,__PYX_ERR(0, 786, __pyx_L1_error))
9206 __Pyx_CppExn2PyErr();
9207 __PYX_ERR(0, 786, __pyx_L1_error)
9209 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
9228 __Pyx_TraceLine(793,0,__PYX_ERR(0, 793, __pyx_L1_error))
9238 __Pyx_TraceLine(801,0,__PYX_ERR(0, 801, __pyx_L1_error))
9240 __pyx_t_11 =
new cCSRAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
9242 __Pyx_CppExn2PyErr();
9243 __PYX_ERR(0, 793, __pyx_L1_error)
9253 __Pyx_TraceLine(793,0,__PYX_ERR(0, 793, __pyx_L1_error))
9254 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
9267 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9270 __Pyx_XDECREF(__pyx_t_1);
9271 __Pyx_XDECREF(__pyx_t_2);
9272 __Pyx_XDECREF(__pyx_t_4);
9273 __Pyx_XDECREF(__pyx_t_5);
9274 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
9275 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
9276 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
9279 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
9280 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
9281 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
9282 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9283 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9284 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9285 __Pyx_XGIVEREF(__pyx_r);
9286 __Pyx_TraceReturn(__pyx_r, 0);
9287 __Pyx_RefNannyFinishContext();
9300 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9301 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float[] =
"pycAffineMatrixFunction.set_csc_matrix_float(self, A, B, B_is_identity)\n\n ";
9302 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float = {
"set_csc_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float};
9303 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9304 PyObject *__pyx_v_A = 0;
9305 PyObject *__pyx_v_B = 0;
9306 PyObject *__pyx_v_B_is_identity = 0;
9307 int __pyx_lineno = 0;
9308 const char *__pyx_filename = NULL;
9309 int __pyx_clineno = 0;
9310 PyObject *__pyx_r = 0;
9311 __Pyx_RefNannyDeclarations
9312 __Pyx_RefNannySetupContext(
"set_csc_matrix_float (wrapper)", 0);
9314 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
9315 PyObject* values[3] = {0,0,0};
9316 if (unlikely(__pyx_kwds)) {
9318 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9320 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9322 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9324 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9327 default:
goto __pyx_L5_argtuple_error;
9329 kw_args = PyDict_Size(__pyx_kwds);
9332 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
9333 else goto __pyx_L5_argtuple_error;
9336 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
9338 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 807, __pyx_L3_error)
9342 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
9344 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 807, __pyx_L3_error)
9347 if (unlikely(kw_args > 0)) {
9348 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csc_matrix_float") < 0)) __PYX_ERR(0, 807, __pyx_L3_error)
9350 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9351 goto __pyx_L5_argtuple_error;
9353 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9354 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9355 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9357 __pyx_v_A = values[0];
9358 __pyx_v_B = values[1];
9359 __pyx_v_B_is_identity = values[2];
9361 goto __pyx_L4_argument_unpacking_done;
9362 __pyx_L5_argtuple_error:;
9363 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 807, __pyx_L3_error)
9365 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
9366 __Pyx_RefNannyFinishContext();
9368 __pyx_L4_argument_unpacking_done:;
9369 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
9372 __Pyx_RefNannyFinishContext();
9376 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
9379 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9380 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9381 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9382 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9383 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9384 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9385 float *__pyx_v_A_data;
9388 float *__pyx_v_B_data;
9391 PyObject *__pyx_r = NULL;
9392 __Pyx_TraceDeclarations
9393 __Pyx_RefNannyDeclarations
9394 PyObject *__pyx_t_1 = NULL;
9395 PyObject *__pyx_t_2 = NULL;
9397 PyObject *__pyx_t_4 = NULL;
9398 PyObject *__pyx_t_5 = NULL;
9399 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
9400 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
9403 Py_ssize_t __pyx_t_10;
9405 int __pyx_lineno = 0;
9406 const char *__pyx_filename = NULL;
9407 int __pyx_clineno = 0;
9408 __Pyx_TraceFrameInit(__pyx_codeobj__15)
9409 __Pyx_RefNannySetupContext(
"set_csc_matrix_float", 0);
9410 __Pyx_TraceCall(
"set_csc_matrix_float", __pyx_f[0], 807, 0, __PYX_ERR(0, 807, __pyx_L1_error));
9419 __Pyx_TraceLine(812,0,__PYX_ERR(0, 812, __pyx_L1_error))
9420 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error)
9421 __Pyx_GOTREF(__pyx_t_1);
9422 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error)
9423 __Pyx_GOTREF(__pyx_t_2);
9424 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9425 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 812, __pyx_L1_error)
9426 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9427 __pyx_v_A_num_rows = __pyx_t_3;
9436 __Pyx_TraceLine(813,0,__PYX_ERR(0, 813, __pyx_L1_error))
9437 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
9438 __Pyx_GOTREF(__pyx_t_2);
9439 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
9440 __Pyx_GOTREF(__pyx_t_1);
9441 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9442 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 813, __pyx_L1_error)
9443 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9444 __pyx_v_A_num_columns = __pyx_t_3;
9453 __Pyx_TraceLine(817,0,__PYX_ERR(0, 817, __pyx_L1_error))
9454 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9455 __Pyx_GOTREF(__pyx_t_1);
9456 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error)
9457 __Pyx_GOTREF(__pyx_t_2);
9458 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9459 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9460 __Pyx_GOTREF(__pyx_t_1);
9461 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error)
9462 __Pyx_GOTREF(__pyx_t_4);
9463 __Pyx_GIVEREF(__pyx_t_1);
9464 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9466 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9467 __Pyx_GOTREF(__pyx_t_1);
9468 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 817, __pyx_L1_error)
9469 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error)
9470 __Pyx_GOTREF(__pyx_t_5);
9471 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9472 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9473 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9482 __Pyx_TraceLine(816,0,__PYX_ERR(0, 816, __pyx_L1_error))
9483 __Pyx_GIVEREF(__pyx_t_5);
9484 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
9485 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
9486 __pyx_v_self->A_indices_copy = __pyx_t_5;
9496 __Pyx_TraceLine(819,0,__PYX_ERR(0, 819, __pyx_L1_error))
9497 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9498 __Pyx_GOTREF(__pyx_t_5);
9499 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
9500 __Pyx_GOTREF(__pyx_t_1);
9501 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9502 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9503 __Pyx_GOTREF(__pyx_t_5);
9504 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L1_error)
9505 __Pyx_GOTREF(__pyx_t_4);
9506 __Pyx_GIVEREF(__pyx_t_5);
9507 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9509 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9510 __Pyx_GOTREF(__pyx_t_5);
9511 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 819, __pyx_L1_error)
9512 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
9513 __Pyx_GOTREF(__pyx_t_2);
9514 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9515 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9516 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9525 __Pyx_TraceLine(818,0,__PYX_ERR(0, 818, __pyx_L1_error))
9526 __Pyx_GIVEREF(__pyx_t_2);
9527 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
9528 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
9529 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
9539 __Pyx_TraceLine(822,0,__PYX_ERR(0, 822, __pyx_L1_error))
9540 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error)
9541 __Pyx_GOTREF(__pyx_t_2);
9542 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 822, __pyx_L1_error)
9543 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9544 __pyx_v_A_data_mv = __pyx_t_6;
9545 __pyx_t_6.memview = NULL;
9546 __pyx_t_6.data = NULL;
9555 __Pyx_TraceLine(823,0,__PYX_ERR(0, 823, __pyx_L1_error))
9556 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 823, __pyx_L1_error)
9557 __pyx_v_A_indices_mv = __pyx_t_7;
9558 __pyx_t_7.memview = NULL;
9559 __pyx_t_7.data = NULL;
9568 __Pyx_TraceLine(825,0,__PYX_ERR(0, 825, __pyx_L1_error))
9569 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 825, __pyx_L1_error)
9570 __pyx_v_A_index_pointer_mv = __pyx_t_7;
9571 __pyx_t_7.memview = NULL;
9572 __pyx_t_7.data = NULL;
9581 __Pyx_TraceLine(826,0,__PYX_ERR(0, 826, __pyx_L1_error))
9582 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 826, __pyx_L1_error)
9583 __pyx_v_B_data_mv = __pyx_t_6;
9584 __pyx_t_6.memview = NULL;
9585 __pyx_t_6.data = NULL;
9594 __Pyx_TraceLine(827,0,__PYX_ERR(0, 827, __pyx_L1_error))
9595 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 827, __pyx_L1_error)
9596 __pyx_v_B_indices_mv = __pyx_t_7;
9597 __pyx_t_7.memview = NULL;
9598 __pyx_t_7.data = NULL;
9607 __Pyx_TraceLine(828,0,__PYX_ERR(0, 828, __pyx_L1_error))
9608 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 828, __pyx_L1_error)
9609 __pyx_v_B_index_pointer_mv = __pyx_t_7;
9610 __pyx_t_7.memview = NULL;
9611 __pyx_t_7.data = NULL;
9620 __Pyx_TraceLine(830,0,__PYX_ERR(0, 830, __pyx_L1_error))
9621 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
9622 __pyx_t_9 = ((!__pyx_t_8) != 0);
9632 __Pyx_TraceLine(834,0,__PYX_ERR(0, 834, __pyx_L1_error))
9633 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9634 __Pyx_GOTREF(__pyx_t_2);
9635 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 834, __pyx_L1_error)
9636 __Pyx_GOTREF(__pyx_t_5);
9637 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9638 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9639 __Pyx_GOTREF(__pyx_t_2);
9640 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error)
9641 __Pyx_GOTREF(__pyx_t_4);
9642 __Pyx_GIVEREF(__pyx_t_2);
9643 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
9645 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9646 __Pyx_GOTREF(__pyx_t_2);
9647 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 834, __pyx_L1_error)
9648 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
9649 __Pyx_GOTREF(__pyx_t_1);
9650 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9651 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9652 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9661 __Pyx_TraceLine(833,0,__PYX_ERR(0, 833, __pyx_L1_error))
9662 __Pyx_GIVEREF(__pyx_t_1);
9663 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
9664 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
9665 __pyx_v_self->B_indices_copy = __pyx_t_1;
9675 __Pyx_TraceLine(836,0,__PYX_ERR(0, 836, __pyx_L1_error))
9676 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9677 __Pyx_GOTREF(__pyx_t_1);
9678 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error)
9679 __Pyx_GOTREF(__pyx_t_2);
9680 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9681 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9682 __Pyx_GOTREF(__pyx_t_1);
9683 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error)
9684 __Pyx_GOTREF(__pyx_t_4);
9685 __Pyx_GIVEREF(__pyx_t_1);
9686 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9688 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9689 __Pyx_GOTREF(__pyx_t_1);
9690 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
9691 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 836, __pyx_L1_error)
9692 __Pyx_GOTREF(__pyx_t_5);
9693 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9694 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9695 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9704 __Pyx_TraceLine(835,0,__PYX_ERR(0, 835, __pyx_L1_error))
9705 __Pyx_GIVEREF(__pyx_t_5);
9706 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
9707 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
9708 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
9718 __Pyx_TraceLine(838,0,__PYX_ERR(0, 838, __pyx_L1_error))
9719 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
9720 __Pyx_GOTREF(__pyx_t_5);
9721 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 838, __pyx_L1_error)
9722 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9723 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9724 __pyx_v_B_data_mv = __pyx_t_6;
9725 __pyx_t_6.memview = NULL;
9726 __pyx_t_6.data = NULL;
9735 __Pyx_TraceLine(839,0,__PYX_ERR(0, 839, __pyx_L1_error))
9736 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 839, __pyx_L1_error)
9737 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9738 __pyx_v_B_indices_mv = __pyx_t_7;
9739 __pyx_t_7.memview = NULL;
9740 __pyx_t_7.data = NULL;
9749 __Pyx_TraceLine(840,0,__PYX_ERR(0, 840, __pyx_L1_error))
9750 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 840, __pyx_L1_error)
9751 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9752 __pyx_v_B_index_pointer_mv = __pyx_t_7;
9753 __pyx_t_7.memview = NULL;
9754 __pyx_t_7.data = NULL;
9772 __Pyx_TraceLine(843,0,__PYX_ERR(0, 843, __pyx_L1_error))
9774 __pyx_v_A_data = (&(*((
float *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
9783 __Pyx_TraceLine(844,0,__PYX_ERR(0, 844, __pyx_L1_error))
9785 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
9794 __Pyx_TraceLine(845,0,__PYX_ERR(0, 845, __pyx_L1_error))
9796 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
9805 __Pyx_TraceLine(846,0,__PYX_ERR(0, 846, __pyx_L1_error))
9806 __pyx_v_B_data = NULL;
9815 __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L1_error))
9816 __pyx_v_B_indices = NULL;
9825 __Pyx_TraceLine(848,0,__PYX_ERR(0, 848, __pyx_L1_error))
9826 __pyx_v_B_index_pointer = NULL;
9835 __Pyx_TraceLine(850,0,__PYX_ERR(0, 850, __pyx_L1_error))
9836 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 850, __pyx_L1_error)
9837 __pyx_t_8 = ((!__pyx_t_9) != 0);
9847 __Pyx_TraceLine(851,0,__PYX_ERR(0, 851, __pyx_L1_error))
9849 __pyx_v_B_data = (&(*((
float *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
9858 __Pyx_TraceLine(852,0,__PYX_ERR(0, 852, __pyx_L1_error))
9860 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
9869 __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L1_error))
9871 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
9889 __Pyx_TraceLine(856,0,__PYX_ERR(0, 856, __pyx_L1_error))
9890 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error)
9900 __Pyx_TraceLine(857,0,__PYX_ERR(0, 857, __pyx_L1_error))
9902 __pyx_t_11 =
new cCSCAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
9904 __Pyx_CppExn2PyErr();
9905 __PYX_ERR(0, 857, __pyx_L1_error)
9907 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
9926 __Pyx_TraceLine(864,0,__PYX_ERR(0, 864, __pyx_L1_error))
9936 __Pyx_TraceLine(872,0,__PYX_ERR(0, 872, __pyx_L1_error))
9938 __pyx_t_11 =
new cCSCAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
9940 __Pyx_CppExn2PyErr();
9941 __PYX_ERR(0, 864, __pyx_L1_error)
9951 __Pyx_TraceLine(864,0,__PYX_ERR(0, 864, __pyx_L1_error))
9952 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
9965 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9968 __Pyx_XDECREF(__pyx_t_1);
9969 __Pyx_XDECREF(__pyx_t_2);
9970 __Pyx_XDECREF(__pyx_t_4);
9971 __Pyx_XDECREF(__pyx_t_5);
9972 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
9973 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
9974 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
9977 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
9978 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
9979 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
9980 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9981 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9982 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9983 __Pyx_XGIVEREF(__pyx_r);
9984 __Pyx_TraceReturn(__pyx_r, 0);
9985 __Pyx_RefNannyFinishContext();
9998 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9999 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double[] =
"pycAffineMatrixFunction.set_csc_matrix_double(self, A, B, B_is_identity)\n\n ";
10000 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double = {
"set_csc_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double};
10001 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10002 PyObject *__pyx_v_A = 0;
10003 PyObject *__pyx_v_B = 0;
10004 PyObject *__pyx_v_B_is_identity = 0;
10005 int __pyx_lineno = 0;
10006 const char *__pyx_filename = NULL;
10007 int __pyx_clineno = 0;
10008 PyObject *__pyx_r = 0;
10009 __Pyx_RefNannyDeclarations
10010 __Pyx_RefNannySetupContext(
"set_csc_matrix_double (wrapper)", 0);
10012 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
10013 PyObject* values[3] = {0,0,0};
10014 if (unlikely(__pyx_kwds)) {
10015 Py_ssize_t kw_args;
10016 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10017 switch (pos_args) {
10018 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10019 CYTHON_FALLTHROUGH;
10020 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10021 CYTHON_FALLTHROUGH;
10022 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10023 CYTHON_FALLTHROUGH;
10025 default:
goto __pyx_L5_argtuple_error;
10027 kw_args = PyDict_Size(__pyx_kwds);
10028 switch (pos_args) {
10030 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
10031 else goto __pyx_L5_argtuple_error;
10032 CYTHON_FALLTHROUGH;
10034 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
10036 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 878, __pyx_L3_error)
10038 CYTHON_FALLTHROUGH;
10040 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
10042 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 878, __pyx_L3_error)
10045 if (unlikely(kw_args > 0)) {
10046 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csc_matrix_double") < 0)) __PYX_ERR(0, 878, __pyx_L3_error)
10048 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
10049 goto __pyx_L5_argtuple_error;
10051 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10052 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10053 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10055 __pyx_v_A = values[0];
10056 __pyx_v_B = values[1];
10057 __pyx_v_B_is_identity = values[2];
10059 goto __pyx_L4_argument_unpacking_done;
10060 __pyx_L5_argtuple_error:;
10061 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 878, __pyx_L3_error)
10063 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
10064 __Pyx_RefNannyFinishContext();
10066 __pyx_L4_argument_unpacking_done:;
10067 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
10070 __Pyx_RefNannyFinishContext();
10074 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
10077 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10078 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10079 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10080 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10081 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10082 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10083 double *__pyx_v_A_data;
10086 double *__pyx_v_B_data;
10089 PyObject *__pyx_r = NULL;
10090 __Pyx_TraceDeclarations
10091 __Pyx_RefNannyDeclarations
10092 PyObject *__pyx_t_1 = NULL;
10093 PyObject *__pyx_t_2 = NULL;
10095 PyObject *__pyx_t_4 = NULL;
10096 PyObject *__pyx_t_5 = NULL;
10097 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
10098 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
10101 Py_ssize_t __pyx_t_10;
10103 int __pyx_lineno = 0;
10104 const char *__pyx_filename = NULL;
10105 int __pyx_clineno = 0;
10106 __Pyx_TraceFrameInit(__pyx_codeobj__16)
10107 __Pyx_RefNannySetupContext(
"set_csc_matrix_double", 0);
10108 __Pyx_TraceCall(
"set_csc_matrix_double", __pyx_f[0], 878, 0, __PYX_ERR(0, 878, __pyx_L1_error));
10117 __Pyx_TraceLine(883,0,__PYX_ERR(0, 883, __pyx_L1_error))
10118 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error)
10119 __Pyx_GOTREF(__pyx_t_1);
10120 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error)
10121 __Pyx_GOTREF(__pyx_t_2);
10122 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10123 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error)
10124 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10125 __pyx_v_A_num_rows = __pyx_t_3;
10134 __Pyx_TraceLine(884,0,__PYX_ERR(0, 884, __pyx_L1_error))
10135 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error)
10136 __Pyx_GOTREF(__pyx_t_2);
10137 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
10138 __Pyx_GOTREF(__pyx_t_1);
10139 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10140 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
10141 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10142 __pyx_v_A_num_columns = __pyx_t_3;
10151 __Pyx_TraceLine(888,0,__PYX_ERR(0, 888, __pyx_L1_error))
10152 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
10153 __Pyx_GOTREF(__pyx_t_1);
10154 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error)
10155 __Pyx_GOTREF(__pyx_t_2);
10156 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10157 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
10158 __Pyx_GOTREF(__pyx_t_1);
10159 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error)
10160 __Pyx_GOTREF(__pyx_t_4);
10161 __Pyx_GIVEREF(__pyx_t_1);
10162 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10164 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
10165 __Pyx_GOTREF(__pyx_t_1);
10166 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
10167 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L1_error)
10168 __Pyx_GOTREF(__pyx_t_5);
10169 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10170 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10171 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10180 __Pyx_TraceLine(887,0,__PYX_ERR(0, 887, __pyx_L1_error))
10181 __Pyx_GIVEREF(__pyx_t_5);
10182 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
10183 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
10184 __pyx_v_self->A_indices_copy = __pyx_t_5;
10194 __Pyx_TraceLine(890,0,__PYX_ERR(0, 890, __pyx_L1_error))
10195 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
10196 __Pyx_GOTREF(__pyx_t_5);
10197 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
10198 __Pyx_GOTREF(__pyx_t_1);
10199 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10200 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
10201 __Pyx_GOTREF(__pyx_t_5);
10202 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error)
10203 __Pyx_GOTREF(__pyx_t_4);
10204 __Pyx_GIVEREF(__pyx_t_5);
10205 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10207 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
10208 __Pyx_GOTREF(__pyx_t_5);
10209 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 890, __pyx_L1_error)
10210 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L1_error)
10211 __Pyx_GOTREF(__pyx_t_2);
10212 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10213 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10214 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10223 __Pyx_TraceLine(889,0,__PYX_ERR(0, 889, __pyx_L1_error))
10224 __Pyx_GIVEREF(__pyx_t_2);
10225 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
10226 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
10227 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
10237 __Pyx_TraceLine(893,0,__PYX_ERR(0, 893, __pyx_L1_error))
10238 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error)
10239 __Pyx_GOTREF(__pyx_t_2);
10240 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 893, __pyx_L1_error)
10241 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10242 __pyx_v_A_data_mv = __pyx_t_6;
10243 __pyx_t_6.memview = NULL;
10244 __pyx_t_6.data = NULL;
10253 __Pyx_TraceLine(894,0,__PYX_ERR(0, 894, __pyx_L1_error))
10254 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 894, __pyx_L1_error)
10255 __pyx_v_A_indices_mv = __pyx_t_7;
10256 __pyx_t_7.memview = NULL;
10257 __pyx_t_7.data = NULL;
10266 __Pyx_TraceLine(896,0,__PYX_ERR(0, 896, __pyx_L1_error))
10267 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 896, __pyx_L1_error)
10268 __pyx_v_A_index_pointer_mv = __pyx_t_7;
10269 __pyx_t_7.memview = NULL;
10270 __pyx_t_7.data = NULL;
10279 __Pyx_TraceLine(897,0,__PYX_ERR(0, 897, __pyx_L1_error))
10280 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 897, __pyx_L1_error)
10281 __pyx_v_B_data_mv = __pyx_t_6;
10282 __pyx_t_6.memview = NULL;
10283 __pyx_t_6.data = NULL;
10292 __Pyx_TraceLine(898,0,__PYX_ERR(0, 898, __pyx_L1_error))
10293 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 898, __pyx_L1_error)
10294 __pyx_v_B_indices_mv = __pyx_t_7;
10295 __pyx_t_7.memview = NULL;
10296 __pyx_t_7.data = NULL;
10305 __Pyx_TraceLine(899,0,__PYX_ERR(0, 899, __pyx_L1_error))
10306 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 899, __pyx_L1_error)
10307 __pyx_v_B_index_pointer_mv = __pyx_t_7;
10308 __pyx_t_7.memview = NULL;
10309 __pyx_t_7.data = NULL;
10318 __Pyx_TraceLine(901,0,__PYX_ERR(0, 901, __pyx_L1_error))
10319 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
10320 __pyx_t_9 = ((!__pyx_t_8) != 0);
10330 __Pyx_TraceLine(905,0,__PYX_ERR(0, 905, __pyx_L1_error))
10331 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10332 __Pyx_GOTREF(__pyx_t_2);
10333 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L1_error)
10334 __Pyx_GOTREF(__pyx_t_5);
10335 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10336 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10337 __Pyx_GOTREF(__pyx_t_2);
10338 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error)
10339 __Pyx_GOTREF(__pyx_t_4);
10340 __Pyx_GIVEREF(__pyx_t_2);
10341 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
10343 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10344 __Pyx_GOTREF(__pyx_t_2);
10345 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 905, __pyx_L1_error)
10346 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
10347 __Pyx_GOTREF(__pyx_t_1);
10348 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10349 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10350 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10359 __Pyx_TraceLine(904,0,__PYX_ERR(0, 904, __pyx_L1_error))
10360 __Pyx_GIVEREF(__pyx_t_1);
10361 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
10362 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
10363 __pyx_v_self->B_indices_copy = __pyx_t_1;
10373 __Pyx_TraceLine(907,0,__PYX_ERR(0, 907, __pyx_L1_error))
10374 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10375 __Pyx_GOTREF(__pyx_t_1);
10376 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
10377 __Pyx_GOTREF(__pyx_t_2);
10378 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10379 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10380 __Pyx_GOTREF(__pyx_t_1);
10381 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
10382 __Pyx_GOTREF(__pyx_t_4);
10383 __Pyx_GIVEREF(__pyx_t_1);
10384 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10386 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10387 __Pyx_GOTREF(__pyx_t_1);
10388 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 907, __pyx_L1_error)
10389 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
10390 __Pyx_GOTREF(__pyx_t_5);
10391 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10392 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10402 __Pyx_TraceLine(906,0,__PYX_ERR(0, 906, __pyx_L1_error))
10403 __Pyx_GIVEREF(__pyx_t_5);
10404 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
10405 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
10406 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
10416 __Pyx_TraceLine(909,0,__PYX_ERR(0, 909, __pyx_L1_error))
10417 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error)
10418 __Pyx_GOTREF(__pyx_t_5);
10419 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 909, __pyx_L1_error)
10420 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10421 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
10422 __pyx_v_B_data_mv = __pyx_t_6;
10423 __pyx_t_6.memview = NULL;
10424 __pyx_t_6.data = NULL;
10433 __Pyx_TraceLine(910,0,__PYX_ERR(0, 910, __pyx_L1_error))
10434 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 910, __pyx_L1_error)
10435 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
10436 __pyx_v_B_indices_mv = __pyx_t_7;
10437 __pyx_t_7.memview = NULL;
10438 __pyx_t_7.data = NULL;
10447 __Pyx_TraceLine(911,0,__PYX_ERR(0, 911, __pyx_L1_error))
10448 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 911, __pyx_L1_error)
10449 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
10450 __pyx_v_B_index_pointer_mv = __pyx_t_7;
10451 __pyx_t_7.memview = NULL;
10452 __pyx_t_7.data = NULL;
10470 __Pyx_TraceLine(914,0,__PYX_ERR(0, 914, __pyx_L1_error))
10472 __pyx_v_A_data = (&(*((
double *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
10481 __Pyx_TraceLine(915,0,__PYX_ERR(0, 915, __pyx_L1_error))
10483 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
10492 __Pyx_TraceLine(916,0,__PYX_ERR(0, 916, __pyx_L1_error))
10494 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
10503 __Pyx_TraceLine(917,0,__PYX_ERR(0, 917, __pyx_L1_error))
10504 __pyx_v_B_data = NULL;
10513 __Pyx_TraceLine(918,0,__PYX_ERR(0, 918, __pyx_L1_error))
10514 __pyx_v_B_indices = NULL;
10523 __Pyx_TraceLine(919,0,__PYX_ERR(0, 919, __pyx_L1_error))
10524 __pyx_v_B_index_pointer = NULL;
10533 __Pyx_TraceLine(921,0,__PYX_ERR(0, 921, __pyx_L1_error))
10534 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 921, __pyx_L1_error)
10535 __pyx_t_8 = ((!__pyx_t_9) != 0);
10545 __Pyx_TraceLine(922,0,__PYX_ERR(0, 922, __pyx_L1_error))
10547 __pyx_v_B_data = (&(*((
double *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
10556 __Pyx_TraceLine(923,0,__PYX_ERR(0, 923, __pyx_L1_error))
10558 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
10567 __Pyx_TraceLine(924,0,__PYX_ERR(0, 924, __pyx_L1_error))
10569 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
10587 __Pyx_TraceLine(927,0,__PYX_ERR(0, 927, __pyx_L1_error))
10588 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 927, __pyx_L1_error)
10598 __Pyx_TraceLine(928,0,__PYX_ERR(0, 928, __pyx_L1_error))
10600 __pyx_t_11 =
new cCSCAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
10602 __Pyx_CppExn2PyErr();
10603 __PYX_ERR(0, 928, __pyx_L1_error)
10605 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
10624 __Pyx_TraceLine(935,0,__PYX_ERR(0, 935, __pyx_L1_error))
10634 __Pyx_TraceLine(943,0,__PYX_ERR(0, 943, __pyx_L1_error))
10636 __pyx_t_11 =
new cCSCAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
10638 __Pyx_CppExn2PyErr();
10639 __PYX_ERR(0, 935, __pyx_L1_error)
10649 __Pyx_TraceLine(935,0,__PYX_ERR(0, 935, __pyx_L1_error))
10650 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
10663 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10666 __Pyx_XDECREF(__pyx_t_1);
10667 __Pyx_XDECREF(__pyx_t_2);
10668 __Pyx_XDECREF(__pyx_t_4);
10669 __Pyx_XDECREF(__pyx_t_5);
10670 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
10671 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
10672 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
10675 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
10676 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
10677 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
10678 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
10679 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
10680 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
10681 __Pyx_XGIVEREF(__pyx_r);
10682 __Pyx_TraceReturn(__pyx_r, 0);
10683 __Pyx_RefNannyFinishContext();
10696 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10697 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double[] =
"pycAffineMatrixFunction.set_csc_matrix_long_double(self, A, B, B_is_identity)\n\n ";
10698 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double = {
"set_csc_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double};
10699 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10700 PyObject *__pyx_v_A = 0;
10701 PyObject *__pyx_v_B = 0;
10702 PyObject *__pyx_v_B_is_identity = 0;
10703 int __pyx_lineno = 0;
10704 const char *__pyx_filename = NULL;
10705 int __pyx_clineno = 0;
10706 PyObject *__pyx_r = 0;
10707 __Pyx_RefNannyDeclarations
10708 __Pyx_RefNannySetupContext(
"set_csc_matrix_long_double (wrapper)", 0);
10710 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
10711 PyObject* values[3] = {0,0,0};
10712 if (unlikely(__pyx_kwds)) {
10713 Py_ssize_t kw_args;
10714 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10715 switch (pos_args) {
10716 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10717 CYTHON_FALLTHROUGH;
10718 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10719 CYTHON_FALLTHROUGH;
10720 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10721 CYTHON_FALLTHROUGH;
10723 default:
goto __pyx_L5_argtuple_error;
10725 kw_args = PyDict_Size(__pyx_kwds);
10726 switch (pos_args) {
10728 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
10729 else goto __pyx_L5_argtuple_error;
10730 CYTHON_FALLTHROUGH;
10732 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
10734 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 949, __pyx_L3_error)
10736 CYTHON_FALLTHROUGH;
10738 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
10740 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 949, __pyx_L3_error)
10743 if (unlikely(kw_args > 0)) {
10744 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"set_csc_matrix_long_double") < 0)) __PYX_ERR(0, 949, __pyx_L3_error)
10746 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
10747 goto __pyx_L5_argtuple_error;
10749 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10750 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10751 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10753 __pyx_v_A = values[0];
10754 __pyx_v_B = values[1];
10755 __pyx_v_B_is_identity = values[2];
10757 goto __pyx_L4_argument_unpacking_done;
10758 __pyx_L5_argtuple_error:;
10759 __Pyx_RaiseArgtupleInvalid(
"set_csc_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 949, __pyx_L3_error)
10761 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
10762 __Pyx_RefNannyFinishContext();
10764 __pyx_L4_argument_unpacking_done:;
10765 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
10768 __Pyx_RefNannyFinishContext();
10772 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
10775 __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10776 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10777 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10778 __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10779 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10780 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10781 long double *__pyx_v_A_data;
10784 long double *__pyx_v_B_data;
10787 PyObject *__pyx_r = NULL;
10788 __Pyx_TraceDeclarations
10789 __Pyx_RefNannyDeclarations
10790 PyObject *__pyx_t_1 = NULL;
10791 PyObject *__pyx_t_2 = NULL;
10793 PyObject *__pyx_t_4 = NULL;
10794 PyObject *__pyx_t_5 = NULL;
10795 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
10796 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
10799 Py_ssize_t __pyx_t_10;
10801 int __pyx_lineno = 0;
10802 const char *__pyx_filename = NULL;
10803 int __pyx_clineno = 0;
10804 __Pyx_TraceFrameInit(__pyx_codeobj__17)
10805 __Pyx_RefNannySetupContext(
"set_csc_matrix_long_double", 0);
10806 __Pyx_TraceCall(
"set_csc_matrix_long_double", __pyx_f[0], 949, 0, __PYX_ERR(0, 949, __pyx_L1_error));
10815 __Pyx_TraceLine(954,0,__PYX_ERR(0, 954, __pyx_L1_error))
10816 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
10817 __Pyx_GOTREF(__pyx_t_1);
10818 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error)
10819 __Pyx_GOTREF(__pyx_t_2);
10820 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10821 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L1_error)
10822 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10823 __pyx_v_A_num_rows = __pyx_t_3;
10832 __Pyx_TraceLine(955,0,__PYX_ERR(0, 955, __pyx_L1_error))
10833 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error)
10834 __Pyx_GOTREF(__pyx_t_2);
10835 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
10836 __Pyx_GOTREF(__pyx_t_1);
10837 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10838 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L1_error)
10839 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10840 __pyx_v_A_num_columns = __pyx_t_3;
10849 __Pyx_TraceLine(959,0,__PYX_ERR(0, 959, __pyx_L1_error))
10850 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10851 __Pyx_GOTREF(__pyx_t_1);
10852 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
10853 __Pyx_GOTREF(__pyx_t_2);
10854 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10855 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10856 __Pyx_GOTREF(__pyx_t_1);
10857 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __pyx_L1_error)
10858 __Pyx_GOTREF(__pyx_t_4);
10859 __Pyx_GIVEREF(__pyx_t_1);
10860 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10862 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10863 __Pyx_GOTREF(__pyx_t_1);
10864 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
10865 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 959, __pyx_L1_error)
10866 __Pyx_GOTREF(__pyx_t_5);
10867 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10868 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10869 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10878 __Pyx_TraceLine(958,0,__PYX_ERR(0, 958, __pyx_L1_error))
10879 __Pyx_GIVEREF(__pyx_t_5);
10880 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
10881 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
10882 __pyx_v_self->A_indices_copy = __pyx_t_5;
10892 __Pyx_TraceLine(961,0,__PYX_ERR(0, 961, __pyx_L1_error))
10893 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10894 __Pyx_GOTREF(__pyx_t_5);
10895 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
10896 __Pyx_GOTREF(__pyx_t_1);
10897 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10898 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10899 __Pyx_GOTREF(__pyx_t_5);
10900 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 961, __pyx_L1_error)
10901 __Pyx_GOTREF(__pyx_t_4);
10902 __Pyx_GIVEREF(__pyx_t_5);
10903 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10905 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10906 __Pyx_GOTREF(__pyx_t_5);
10907 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 961, __pyx_L1_error)
10908 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
10909 __Pyx_GOTREF(__pyx_t_2);
10910 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10911 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10912 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10921 __Pyx_TraceLine(960,0,__PYX_ERR(0, 960, __pyx_L1_error))
10922 __Pyx_GIVEREF(__pyx_t_2);
10923 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
10924 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
10925 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
10935 __Pyx_TraceLine(964,0,__PYX_ERR(0, 964, __pyx_L1_error))
10936 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
10937 __Pyx_GOTREF(__pyx_t_2);
10938 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 964, __pyx_L1_error)
10939 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10940 __pyx_v_A_data_mv = __pyx_t_6;
10941 __pyx_t_6.memview = NULL;
10942 __pyx_t_6.data = NULL;
10951 __Pyx_TraceLine(965,0,__PYX_ERR(0, 965, __pyx_L1_error))
10952 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 965, __pyx_L1_error)
10953 __pyx_v_A_indices_mv = __pyx_t_7;
10954 __pyx_t_7.memview = NULL;
10955 __pyx_t_7.data = NULL;
10964 __Pyx_TraceLine(967,0,__PYX_ERR(0, 967, __pyx_L1_error))
10965 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 967, __pyx_L1_error)
10966 __pyx_v_A_index_pointer_mv = __pyx_t_7;
10967 __pyx_t_7.memview = NULL;
10968 __pyx_t_7.data = NULL;
10977 __Pyx_TraceLine(968,0,__PYX_ERR(0, 968, __pyx_L1_error))
10978 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 968, __pyx_L1_error)
10979 __pyx_v_B_data_mv = __pyx_t_6;
10980 __pyx_t_6.memview = NULL;
10981 __pyx_t_6.data = NULL;
10990 __Pyx_TraceLine(969,0,__PYX_ERR(0, 969, __pyx_L1_error))
10991 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 969, __pyx_L1_error)
10992 __pyx_v_B_indices_mv = __pyx_t_7;
10993 __pyx_t_7.memview = NULL;
10994 __pyx_t_7.data = NULL;
11003 __Pyx_TraceLine(970,0,__PYX_ERR(0, 970, __pyx_L1_error))
11004 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 970, __pyx_L1_error)
11005 __pyx_v_B_index_pointer_mv = __pyx_t_7;
11006 __pyx_t_7.memview = NULL;
11007 __pyx_t_7.data = NULL;
11016 __Pyx_TraceLine(972,0,__PYX_ERR(0, 972, __pyx_L1_error))
11017 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 972, __pyx_L1_error)
11018 __pyx_t_9 = ((!__pyx_t_8) != 0);
11028 __Pyx_TraceLine(976,0,__PYX_ERR(0, 976, __pyx_L1_error))
11029 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
11030 __Pyx_GOTREF(__pyx_t_2);
11031 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error)
11032 __Pyx_GOTREF(__pyx_t_5);
11033 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11034 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
11035 __Pyx_GOTREF(__pyx_t_2);
11036 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
11037 __Pyx_GOTREF(__pyx_t_4);
11038 __Pyx_GIVEREF(__pyx_t_2);
11039 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
11041 __pyx_t_2 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
11042 __Pyx_GOTREF(__pyx_t_2);
11043 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 976, __pyx_L1_error)
11044 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
11045 __Pyx_GOTREF(__pyx_t_1);
11046 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11047 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11048 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11057 __Pyx_TraceLine(975,0,__PYX_ERR(0, 975, __pyx_L1_error))
11058 __Pyx_GIVEREF(__pyx_t_1);
11059 __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
11060 __Pyx_DECREF(__pyx_v_self->B_indices_copy);
11061 __pyx_v_self->B_indices_copy = __pyx_t_1;
11071 __Pyx_TraceLine(978,0,__PYX_ERR(0, 978, __pyx_L1_error))
11072 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
11073 __Pyx_GOTREF(__pyx_t_1);
11074 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
11075 __Pyx_GOTREF(__pyx_t_2);
11076 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11077 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
11078 __Pyx_GOTREF(__pyx_t_1);
11079 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error)
11080 __Pyx_GOTREF(__pyx_t_4);
11081 __Pyx_GIVEREF(__pyx_t_1);
11082 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
11084 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
11085 __Pyx_GOTREF(__pyx_t_1);
11086 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 978, __pyx_L1_error)
11087 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L1_error)
11088 __Pyx_GOTREF(__pyx_t_5);
11089 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11090 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11091 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11100 __Pyx_TraceLine(977,0,__PYX_ERR(0, 977, __pyx_L1_error))
11101 __Pyx_GIVEREF(__pyx_t_5);
11102 __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
11103 __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
11104 __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
11114 __Pyx_TraceLine(980,0,__PYX_ERR(0, 980, __pyx_L1_error))
11115 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __pyx_L1_error)
11116 __Pyx_GOTREF(__pyx_t_5);
11117 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 980, __pyx_L1_error)
11118 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11119 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
11120 __pyx_v_B_data_mv = __pyx_t_6;
11121 __pyx_t_6.memview = NULL;
11122 __pyx_t_6.data = NULL;
11131 __Pyx_TraceLine(981,0,__PYX_ERR(0, 981, __pyx_L1_error))
11132 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 981, __pyx_L1_error)
11133 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
11134 __pyx_v_B_indices_mv = __pyx_t_7;
11135 __pyx_t_7.memview = NULL;
11136 __pyx_t_7.data = NULL;
11145 __Pyx_TraceLine(982,0,__PYX_ERR(0, 982, __pyx_L1_error))
11146 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 982, __pyx_L1_error)
11147 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
11148 __pyx_v_B_index_pointer_mv = __pyx_t_7;
11149 __pyx_t_7.memview = NULL;
11150 __pyx_t_7.data = NULL;
11168 __Pyx_TraceLine(985,0,__PYX_ERR(0, 985, __pyx_L1_error))
11170 __pyx_v_A_data = (&(*((
long double *) ( (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
11179 __Pyx_TraceLine(986,0,__PYX_ERR(0, 986, __pyx_L1_error))
11181 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
11190 __Pyx_TraceLine(987,0,__PYX_ERR(0, 987, __pyx_L1_error))
11192 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
11201 __Pyx_TraceLine(988,0,__PYX_ERR(0, 988, __pyx_L1_error))
11202 __pyx_v_B_data = NULL;
11211 __Pyx_TraceLine(989,0,__PYX_ERR(0, 989, __pyx_L1_error))
11212 __pyx_v_B_indices = NULL;
11221 __Pyx_TraceLine(990,0,__PYX_ERR(0, 990, __pyx_L1_error))
11222 __pyx_v_B_index_pointer = NULL;
11231 __Pyx_TraceLine(992,0,__PYX_ERR(0, 992, __pyx_L1_error))
11232 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 992, __pyx_L1_error)
11233 __pyx_t_8 = ((!__pyx_t_9) != 0);
11243 __Pyx_TraceLine(993,0,__PYX_ERR(0, 993, __pyx_L1_error))
11245 __pyx_v_B_data = (&(*((
long double *) ( (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
11254 __Pyx_TraceLine(994,0,__PYX_ERR(0, 994, __pyx_L1_error))
11256 __pyx_v_B_indices = (&(*((
int *) ( (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
11265 __Pyx_TraceLine(995,0,__PYX_ERR(0, 995, __pyx_L1_error))
11267 __pyx_v_B_index_pointer = (&(*((
int *) ( (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
11285 __Pyx_TraceLine(998,0,__PYX_ERR(0, 998, __pyx_L1_error))
11286 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity);
if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 998, __pyx_L1_error)
11296 __Pyx_TraceLine(999,0,__PYX_ERR(0, 999, __pyx_L1_error))
11300 __Pyx_CppExn2PyErr();
11301 __PYX_ERR(0, 999, __pyx_L1_error)
11303 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
11322 __Pyx_TraceLine(1006,0,__PYX_ERR(0, 1006, __pyx_L1_error))
11330 __Pyx_TraceLine(1014,0,__PYX_ERR(0, 1014, __pyx_L1_error))
11332 __pyx_t_11 =
new cCSCAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
11334 __Pyx_CppExn2PyErr();
11335 __PYX_ERR(0, 1006, __pyx_L1_error)
11345 __Pyx_TraceLine(1006,0,__PYX_ERR(0, 1006, __pyx_L1_error))
11346 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
11359 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11362 __Pyx_XDECREF(__pyx_t_1);
11363 __Pyx_XDECREF(__pyx_t_2);
11364 __Pyx_XDECREF(__pyx_t_4);
11365 __Pyx_XDECREF(__pyx_t_5);
11366 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
11367 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
11368 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
11371 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
11372 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
11373 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
11374 __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
11375 __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
11376 __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
11377 __Pyx_XGIVEREF(__pyx_r);
11378 __Pyx_TraceReturn(__pyx_r, 0);
11379 __Pyx_RefNannyFinishContext();
11390 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11391 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__[] =
"pycAffineMatrixFunction.__reduce_cython__(self)";
11392 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__};
11393 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11394 PyObject *__pyx_r = 0;
11395 __Pyx_RefNannyDeclarations
11396 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11397 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self));
11400 __Pyx_RefNannyFinishContext();
11404 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self) {
11405 PyObject *__pyx_r = NULL;
11406 __Pyx_TraceDeclarations
11407 __Pyx_RefNannyDeclarations
11408 PyObject *__pyx_t_1 = NULL;
11409 int __pyx_lineno = 0;
11410 const char *__pyx_filename = NULL;
11411 int __pyx_clineno = 0;
11412 __Pyx_TraceFrameInit(__pyx_codeobj__18)
11413 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11414 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
11422 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
11423 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11424 __Pyx_GOTREF(__pyx_t_1);
11425 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11426 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11427 __PYX_ERR(1, 2, __pyx_L1_error)
11437 __Pyx_XDECREF(__pyx_t_1);
11438 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11440 __Pyx_XGIVEREF(__pyx_r);
11441 __Pyx_TraceReturn(__pyx_r, 0);
11442 __Pyx_RefNannyFinishContext();
11454 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11455 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__[] =
"pycAffineMatrixFunction.__setstate_cython__(self, __pyx_state)";
11456 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__};
11457 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11458 PyObject *__pyx_r = 0;
11459 __Pyx_RefNannyDeclarations
11460 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11461 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11464 __Pyx_RefNannyFinishContext();
11468 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11469 PyObject *__pyx_r = NULL;
11470 __Pyx_TraceDeclarations
11471 __Pyx_RefNannyDeclarations
11472 PyObject *__pyx_t_1 = NULL;
11473 int __pyx_lineno = 0;
11474 const char *__pyx_filename = NULL;
11475 int __pyx_clineno = 0;
11476 __Pyx_TraceFrameInit(__pyx_codeobj__20)
11477 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11478 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
11485 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
11486 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11487 __Pyx_GOTREF(__pyx_t_1);
11488 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11489 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11490 __PYX_ERR(1, 4, __pyx_L1_error)
11501 __Pyx_XDECREF(__pyx_t_1);
11502 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11504 __Pyx_XGIVEREF(__pyx_r);
11505 __Pyx_TraceReturn(__pyx_r, 0);
11506 __Pyx_RefNannyFinishContext();
11519 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11520 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11521 PyObject *__pyx_v_shape = 0;
11522 Py_ssize_t __pyx_v_itemsize;
11523 PyObject *__pyx_v_format = 0;
11524 PyObject *__pyx_v_mode = 0;
11525 int __pyx_v_allocate_buffer;
11526 int __pyx_lineno = 0;
11527 const char *__pyx_filename = NULL;
11528 int __pyx_clineno = 0;
11530 __Pyx_RefNannyDeclarations
11531 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
11533 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
11534 PyObject* values[5] = {0,0,0,0,0};
11535 values[3] = ((PyObject *)__pyx_n_s_c);
11536 if (unlikely(__pyx_kwds)) {
11537 Py_ssize_t kw_args;
11538 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11539 switch (pos_args) {
11540 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11541 CYTHON_FALLTHROUGH;
11542 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11543 CYTHON_FALLTHROUGH;
11544 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11545 CYTHON_FALLTHROUGH;
11546 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11547 CYTHON_FALLTHROUGH;
11548 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11549 CYTHON_FALLTHROUGH;
11551 default:
goto __pyx_L5_argtuple_error;
11553 kw_args = PyDict_Size(__pyx_kwds);
11554 switch (pos_args) {
11556 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
11557 else goto __pyx_L5_argtuple_error;
11558 CYTHON_FALLTHROUGH;
11560 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
11562 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
11564 CYTHON_FALLTHROUGH;
11566 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
11568 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
11570 CYTHON_FALLTHROUGH;
11573 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
11574 if (value) { values[3] = value; kw_args--; }
11576 CYTHON_FALLTHROUGH;
11579 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
11580 if (value) { values[4] = value; kw_args--; }
11583 if (unlikely(kw_args > 0)) {
11584 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
11587 switch (PyTuple_GET_SIZE(__pyx_args)) {
11588 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11589 CYTHON_FALLTHROUGH;
11590 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11591 CYTHON_FALLTHROUGH;
11592 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11593 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11594 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11596 default:
goto __pyx_L5_argtuple_error;
11599 __pyx_v_shape = ((PyObject*)values[0]);
11600 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
11601 __pyx_v_format = values[2];
11602 __pyx_v_mode = values[3];
11604 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
11614 __pyx_v_allocate_buffer = ((int)1);
11617 goto __pyx_L4_argument_unpacking_done;
11618 __pyx_L5_argtuple_error:;
11619 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
11621 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11622 __Pyx_RefNannyFinishContext();
11624 __pyx_L4_argument_unpacking_done:;
11625 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
11626 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
11627 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 123, __pyx_L1_error)
11629 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
11644 __Pyx_RefNannyFinishContext();
11648 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
11650 Py_ssize_t __pyx_v_i;
11651 Py_ssize_t __pyx_v_dim;
11652 PyObject **__pyx_v_p;
11653 char __pyx_v_order;
11655 __Pyx_TraceDeclarations
11656 __Pyx_RefNannyDeclarations
11657 Py_ssize_t __pyx_t_1;
11659 PyObject *__pyx_t_3 = NULL;
11661 PyObject *__pyx_t_5 = NULL;
11662 PyObject *__pyx_t_6 = NULL;
11665 Py_ssize_t __pyx_t_9;
11666 PyObject *__pyx_t_10 = NULL;
11667 Py_ssize_t __pyx_t_11;
11668 int __pyx_lineno = 0;
11669 const char *__pyx_filename = NULL;
11670 int __pyx_clineno = 0;
11671 __Pyx_RefNannySetupContext(
"__cinit__", 0);
11672 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 123, 0, __PYX_ERR(1, 123, __pyx_L1_error));
11673 __Pyx_INCREF(__pyx_v_format);
11682 __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
11683 if (unlikely(__pyx_v_shape == Py_None)) {
11684 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
11685 __PYX_ERR(1, 130, __pyx_L1_error)
11687 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
11688 __pyx_v_self->ndim = ((int)__pyx_t_1);
11697 __Pyx_TraceLine(131,0,__PYX_ERR(1, 131, __pyx_L1_error))
11698 __pyx_v_self->itemsize = __pyx_v_itemsize;
11707 __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
11708 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
11709 if (unlikely(__pyx_t_2)) {
11718 __Pyx_TraceLine(134,0,__PYX_ERR(1, 134, __pyx_L1_error))
11719 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
11720 __Pyx_GOTREF(__pyx_t_3);
11721 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11722 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11723 __PYX_ERR(1, 134, __pyx_L1_error)
11741 __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
11742 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
11743 if (unlikely(__pyx_t_2)) {
11752 __Pyx_TraceLine(137,0,__PYX_ERR(1, 137, __pyx_L1_error))
11753 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
11754 __Pyx_GOTREF(__pyx_t_3);
11755 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11756 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11757 __PYX_ERR(1, 137, __pyx_L1_error)
11775 __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
11776 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
11777 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
11787 __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
11788 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
11789 __Pyx_GOTREF(__pyx_t_5);
11791 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11792 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
11793 if (likely(__pyx_t_6)) {
11794 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11795 __Pyx_INCREF(__pyx_t_6);
11796 __Pyx_INCREF(
function);
11797 __Pyx_DECREF_SET(__pyx_t_5,
function);
11800 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
11801 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11802 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
11803 __Pyx_GOTREF(__pyx_t_3);
11804 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11805 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
11824 __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
11825 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
11826 __pyx_t_3 = __pyx_v_format;
11827 __Pyx_INCREF(__pyx_t_3);
11828 __Pyx_GIVEREF(__pyx_t_3);
11829 __Pyx_GOTREF(__pyx_v_self->_format);
11830 __Pyx_DECREF(__pyx_v_self->_format);
11831 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
11841 __Pyx_TraceLine(142,0,__PYX_ERR(1, 142, __pyx_L1_error))
11842 if (unlikely(__pyx_v_self->_format == Py_None)) {
11843 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
11844 __PYX_ERR(1, 142, __pyx_L1_error)
11846 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
11847 __pyx_v_self->format = __pyx_t_7;
11856 __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
11857 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
11866 __Pyx_TraceLine(146,0,__PYX_ERR(1, 146, __pyx_L1_error))
11867 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
11876 __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
11877 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
11878 if (unlikely(__pyx_t_4)) {
11887 __Pyx_TraceLine(149,0,__PYX_ERR(1, 149, __pyx_L1_error))
11888 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
11889 __Pyx_GOTREF(__pyx_t_3);
11890 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11891 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11892 __PYX_ERR(1, 149, __pyx_L1_error)
11910 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
11912 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
11914 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
11915 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11916 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
11918 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
11919 __Pyx_GOTREF(__pyx_t_5);
11921 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
11922 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11923 __pyx_v_dim = __pyx_t_9;
11924 __pyx_v_idx = __pyx_t_8;
11925 __pyx_t_8 = (__pyx_t_8 + 1);
11934 __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
11935 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
11936 if (unlikely(__pyx_t_4)) {
11945 __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
11946 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
11947 __Pyx_GOTREF(__pyx_t_5);
11948 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
11949 __Pyx_GOTREF(__pyx_t_6);
11950 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
11951 __Pyx_GOTREF(__pyx_t_10);
11952 __Pyx_GIVEREF(__pyx_t_5);
11953 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
11954 __Pyx_GIVEREF(__pyx_t_6);
11955 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
11958 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
11959 __Pyx_GOTREF(__pyx_t_6);
11960 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11961 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
11962 __Pyx_GOTREF(__pyx_t_10);
11963 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11964 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11965 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11966 __PYX_ERR(1, 154, __pyx_L1_error)
11984 __Pyx_TraceLine(155,0,__PYX_ERR(1, 155, __pyx_L1_error))
11985 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
11994 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
11996 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12005 __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
12006 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
12016 __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
12017 __pyx_v_order =
'F';
12026 __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
12027 __Pyx_INCREF(__pyx_n_u_fortran);
12028 __Pyx_GIVEREF(__pyx_n_u_fortran);
12029 __Pyx_GOTREF(__pyx_v_self->mode);
12030 __Pyx_DECREF(__pyx_v_self->mode);
12031 __pyx_v_self->mode = __pyx_n_u_fortran;
12050 __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
12051 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
12052 if (likely(__pyx_t_4)) {
12061 __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
12062 __pyx_v_order =
'C';
12071 __Pyx_TraceLine(163,0,__PYX_ERR(1, 163, __pyx_L1_error))
12072 __Pyx_INCREF(__pyx_n_u_c);
12073 __Pyx_GIVEREF(__pyx_n_u_c);
12074 __Pyx_GOTREF(__pyx_v_self->mode);
12075 __Pyx_DECREF(__pyx_v_self->mode);
12076 __pyx_v_self->mode = __pyx_n_u_c;
12095 __Pyx_TraceLine(165,0,__PYX_ERR(1, 165, __pyx_L1_error))
12097 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
12098 __Pyx_GOTREF(__pyx_t_3);
12099 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
12100 __Pyx_GOTREF(__pyx_t_10);
12101 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12102 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
12103 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12104 __PYX_ERR(1, 165, __pyx_L1_error)
12115 __Pyx_TraceLine(167,0,__PYX_ERR(1, 167, __pyx_L1_error))
12116 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
12125 __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
12126 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
12135 __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
12136 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
12137 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
12138 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12139 __pyx_v_self->dtype_is_object = __pyx_t_4;
12148 __Pyx_TraceLine(172,0,__PYX_ERR(1, 172, __pyx_L1_error))
12149 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
12159 __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
12160 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
12169 __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
12170 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
12171 if (unlikely(__pyx_t_4)) {
12180 __Pyx_TraceLine(177,0,__PYX_ERR(1, 177, __pyx_L1_error))
12181 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
12182 __Pyx_GOTREF(__pyx_t_10);
12183 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
12184 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12185 __PYX_ERR(1, 177, __pyx_L1_error)
12203 __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
12204 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
12214 __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
12215 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
12224 __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
12225 if (unlikely(__pyx_v_itemsize == 0)) {
12226 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
12227 __PYX_ERR(1, 181, __pyx_L1_error)
12229 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
12230 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
12231 __PYX_ERR(1, 181, __pyx_L1_error)
12233 __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
12234 __pyx_t_9 = __pyx_t_1;
12235 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
12236 __pyx_v_i = __pyx_t_11;
12245 __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
12246 (__pyx_v_p[__pyx_v_i]) = Py_None;
12255 __Pyx_TraceLine(183,0,__PYX_ERR(1, 183, __pyx_L1_error))
12256 Py_INCREF(Py_None);
12289 __Pyx_XDECREF(__pyx_t_3);
12290 __Pyx_XDECREF(__pyx_t_5);
12291 __Pyx_XDECREF(__pyx_t_6);
12292 __Pyx_XDECREF(__pyx_t_10);
12293 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12296 __Pyx_XDECREF(__pyx_v_format);
12297 __Pyx_TraceReturn(Py_None, 0);
12298 __Pyx_RefNannyFinishContext();
12311 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
12312 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12314 __Pyx_RefNannyDeclarations
12315 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
12316 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
12319 __Pyx_RefNannyFinishContext();
12323 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12324 int __pyx_v_bufmode;
12326 __Pyx_TraceDeclarations
12327 __Pyx_RefNannyDeclarations
12330 PyObject *__pyx_t_3 = NULL;
12332 Py_ssize_t __pyx_t_5;
12334 Py_ssize_t *__pyx_t_7;
12335 int __pyx_lineno = 0;
12336 const char *__pyx_filename = NULL;
12337 int __pyx_clineno = 0;
12338 if (__pyx_v_info == NULL) {
12339 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
12342 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
12343 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12344 __Pyx_GIVEREF(__pyx_v_info->obj);
12345 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 186, 0, __PYX_ERR(1, 186, __pyx_L1_error));
12354 __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
12355 __pyx_v_bufmode = -1;
12364 __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
12365 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
12366 __pyx_t_2 = (__pyx_t_1 != 0);
12376 __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
12377 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
12396 __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
12397 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
12398 __pyx_t_1 = (__pyx_t_2 != 0);
12408 __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
12409 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
12428 __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
12429 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
12430 if (unlikely(__pyx_t_1)) {
12439 __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
12440 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
12441 __Pyx_GOTREF(__pyx_t_3);
12442 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12443 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12444 __PYX_ERR(1, 193, __pyx_L1_error)
12462 __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
12463 __pyx_t_4 = __pyx_v_self->data;
12464 __pyx_v_info->buf = __pyx_t_4;
12473 __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
12474 __pyx_t_5 = __pyx_v_self->len;
12475 __pyx_v_info->len = __pyx_t_5;
12484 __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
12485 __pyx_t_6 = __pyx_v_self->ndim;
12486 __pyx_v_info->ndim = __pyx_t_6;
12495 __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
12496 __pyx_t_7 = __pyx_v_self->_shape;
12497 __pyx_v_info->shape = __pyx_t_7;
12506 __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
12507 __pyx_t_7 = __pyx_v_self->_strides;
12508 __pyx_v_info->strides = __pyx_t_7;
12517 __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
12518 __pyx_v_info->suboffsets = NULL;
12527 __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
12528 __pyx_t_5 = __pyx_v_self->itemsize;
12529 __pyx_v_info->itemsize = __pyx_t_5;
12538 __Pyx_TraceLine(201,0,__PYX_ERR(1, 201, __pyx_L1_error))
12539 __pyx_v_info->readonly = 0;
12548 __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
12549 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12559 __Pyx_TraceLine(204,0,__PYX_ERR(1, 204, __pyx_L1_error))
12560 __pyx_t_4 = __pyx_v_self->format;
12561 __pyx_v_info->format = __pyx_t_4;
12580 __Pyx_TraceLine(206,0,__PYX_ERR(1, 206, __pyx_L1_error))
12582 __pyx_v_info->format = NULL;
12593 __Pyx_TraceLine(208,0,__PYX_ERR(1, 208, __pyx_L1_error))
12594 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12595 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12596 __Pyx_GOTREF(__pyx_v_info->obj);
12597 __Pyx_DECREF(__pyx_v_info->obj);
12598 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12612 __Pyx_XDECREF(__pyx_t_3);
12613 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12615 if (__pyx_v_info->obj != NULL) {
12616 __Pyx_GOTREF(__pyx_v_info->obj);
12617 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12621 if (__pyx_v_info->obj == Py_None) {
12622 __Pyx_GOTREF(__pyx_v_info->obj);
12623 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12626 __Pyx_TraceReturn(Py_None, 0);
12627 __Pyx_RefNannyFinishContext();
12640 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
12641 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
12642 __Pyx_RefNannyDeclarations
12643 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
12644 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
12647 __Pyx_RefNannyFinishContext();
12650 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
12651 __Pyx_TraceDeclarations
12652 __Pyx_RefNannyDeclarations
12654 int __pyx_lineno = 0;
12655 const char *__pyx_filename = NULL;
12656 int __pyx_clineno = 0;
12657 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
12658 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 212, 0, __PYX_ERR(1, 212, __pyx_L1_error));
12667 __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
12668 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
12678 __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
12679 __pyx_v_self->callback_free_data(__pyx_v_self->data);
12698 __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
12699 __pyx_t_1 = (__pyx_v_self->free_data != 0);
12709 __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
12710 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12720 __Pyx_TraceLine(217,0,__PYX_ERR(1, 217, __pyx_L1_error))
12721 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
12739 __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
12740 free(__pyx_v_self->data);
12759 __Pyx_TraceLine(220,0,__PYX_ERR(1, 220, __pyx_L1_error))
12760 PyObject_Free(__pyx_v_self->_shape);
12773 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
12775 __Pyx_TraceReturn(Py_None, 0);
12776 __Pyx_RefNannyFinishContext();
12788 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
12789 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
12790 PyObject *__pyx_r = 0;
12791 __Pyx_RefNannyDeclarations
12792 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12793 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
12796 __Pyx_RefNannyFinishContext();
12800 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
12801 PyObject *__pyx_r = NULL;
12802 __Pyx_TraceDeclarations
12803 __Pyx_RefNannyDeclarations
12804 PyObject *__pyx_t_1 = NULL;
12805 int __pyx_lineno = 0;
12806 const char *__pyx_filename = NULL;
12807 int __pyx_clineno = 0;
12808 __Pyx_RefNannySetupContext(
"__get__", 0);
12809 __Pyx_TraceCall(
"__get__", __pyx_f[1], 223, 0, __PYX_ERR(1, 223, __pyx_L1_error));
12818 __Pyx_TraceLine(224,0,__PYX_ERR(1, 224, __pyx_L1_error))
12819 __Pyx_XDECREF(__pyx_r);
12820 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
12821 __Pyx_GOTREF(__pyx_t_1);
12822 __pyx_r = __pyx_t_1;
12836 __Pyx_XDECREF(__pyx_t_1);
12837 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12840 __Pyx_XGIVEREF(__pyx_r);
12841 __Pyx_TraceReturn(__pyx_r, 0);
12842 __Pyx_RefNannyFinishContext();
12854 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
12856 PyObject *__pyx_r = NULL;
12857 __Pyx_TraceDeclarations
12858 __Pyx_RefNannyDeclarations
12859 PyObject *__pyx_t_1 = NULL;
12860 PyObject *__pyx_t_2 = NULL;
12861 PyObject *__pyx_t_3 = NULL;
12862 int __pyx_lineno = 0;
12863 const char *__pyx_filename = NULL;
12864 int __pyx_clineno = 0;
12865 __Pyx_RefNannySetupContext(
"get_memview", 0);
12866 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 227, 0, __PYX_ERR(1, 227, __pyx_L1_error));
12875 __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
12876 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
12885 __Pyx_TraceLine(229,0,__PYX_ERR(1, 229, __pyx_L1_error))
12886 __Pyx_XDECREF(__pyx_r);
12887 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
12888 __Pyx_GOTREF(__pyx_t_1);
12889 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
12890 __Pyx_GOTREF(__pyx_t_2);
12891 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
12892 __Pyx_GOTREF(__pyx_t_3);
12893 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12894 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12895 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
12896 __Pyx_GIVEREF(__pyx_t_1);
12897 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
12898 __Pyx_GIVEREF(__pyx_t_2);
12899 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
12902 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
12903 __Pyx_GOTREF(__pyx_t_2);
12904 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12905 __pyx_r = __pyx_t_2;
12919 __Pyx_XDECREF(__pyx_t_1);
12920 __Pyx_XDECREF(__pyx_t_2);
12921 __Pyx_XDECREF(__pyx_t_3);
12922 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
12925 __Pyx_XGIVEREF(__pyx_r);
12926 __Pyx_TraceReturn(__pyx_r, 0);
12927 __Pyx_RefNannyFinishContext();
12940 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
12941 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
12942 Py_ssize_t __pyx_r;
12943 __Pyx_RefNannyDeclarations
12944 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
12945 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
12948 __Pyx_RefNannyFinishContext();
12952 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
12953 Py_ssize_t __pyx_r;
12954 __Pyx_TraceDeclarations
12955 __Pyx_RefNannyDeclarations
12956 int __pyx_lineno = 0;
12957 const char *__pyx_filename = NULL;
12958 int __pyx_clineno = 0;
12959 __Pyx_RefNannySetupContext(
"__len__", 0);
12960 __Pyx_TraceCall(
"__len__", __pyx_f[1], 231, 0, __PYX_ERR(1, 231, __pyx_L1_error));
12969 __Pyx_TraceLine(232,0,__PYX_ERR(1, 232, __pyx_L1_error))
12970 __pyx_r = (__pyx_v_self->_shape[0]);
12983 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12986 __Pyx_TraceReturn(Py_None, 0);
12987 __Pyx_RefNannyFinishContext();
13000 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
13001 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
13002 PyObject *__pyx_r = 0;
13003 __Pyx_RefNannyDeclarations
13004 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
13005 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
13008 __Pyx_RefNannyFinishContext();
13012 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
13013 PyObject *__pyx_r = NULL;
13014 __Pyx_TraceDeclarations
13015 __Pyx_RefNannyDeclarations
13016 PyObject *__pyx_t_1 = NULL;
13017 PyObject *__pyx_t_2 = NULL;
13018 int __pyx_lineno = 0;
13019 const char *__pyx_filename = NULL;
13020 int __pyx_clineno = 0;
13021 __Pyx_RefNannySetupContext(
"__getattr__", 0);
13022 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));
13031 __Pyx_TraceLine(235,0,__PYX_ERR(1, 235, __pyx_L1_error))
13032 __Pyx_XDECREF(__pyx_r);
13033 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
13034 __Pyx_GOTREF(__pyx_t_1);
13035 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
13036 __Pyx_GOTREF(__pyx_t_2);
13037 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13038 __pyx_r = __pyx_t_2;
13052 __Pyx_XDECREF(__pyx_t_1);
13053 __Pyx_XDECREF(__pyx_t_2);
13054 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13057 __Pyx_XGIVEREF(__pyx_r);
13058 __Pyx_TraceReturn(__pyx_r, 0);
13059 __Pyx_RefNannyFinishContext();
13072 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
13073 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
13074 PyObject *__pyx_r = 0;
13075 __Pyx_RefNannyDeclarations
13076 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
13077 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
13080 __Pyx_RefNannyFinishContext();
13084 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
13085 PyObject *__pyx_r = NULL;
13086 __Pyx_TraceDeclarations
13087 __Pyx_RefNannyDeclarations
13088 PyObject *__pyx_t_1 = NULL;
13089 PyObject *__pyx_t_2 = NULL;
13090 int __pyx_lineno = 0;
13091 const char *__pyx_filename = NULL;
13092 int __pyx_clineno = 0;
13093 __Pyx_RefNannySetupContext(
"__getitem__", 0);
13094 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 237, 0, __PYX_ERR(1, 237, __pyx_L1_error));
13103 __Pyx_TraceLine(238,0,__PYX_ERR(1, 238, __pyx_L1_error))
13104 __Pyx_XDECREF(__pyx_r);
13105 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
13106 __Pyx_GOTREF(__pyx_t_1);
13107 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
13108 __Pyx_GOTREF(__pyx_t_2);
13109 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13110 __pyx_r = __pyx_t_2;
13124 __Pyx_XDECREF(__pyx_t_1);
13125 __Pyx_XDECREF(__pyx_t_2);
13126 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13129 __Pyx_XGIVEREF(__pyx_r);
13130 __Pyx_TraceReturn(__pyx_r, 0);
13131 __Pyx_RefNannyFinishContext();
13144 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
13145 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
13147 __Pyx_RefNannyDeclarations
13148 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
13149 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
13152 __Pyx_RefNannyFinishContext();
13156 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
13158 __Pyx_TraceDeclarations
13159 __Pyx_RefNannyDeclarations
13160 PyObject *__pyx_t_1 = NULL;
13161 int __pyx_lineno = 0;
13162 const char *__pyx_filename = NULL;
13163 int __pyx_clineno = 0;
13164 __Pyx_RefNannySetupContext(
"__setitem__", 0);
13165 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 240, 0, __PYX_ERR(1, 240, __pyx_L1_error));
13174 __Pyx_TraceLine(241,0,__PYX_ERR(1, 241, __pyx_L1_error))
13175 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
13176 __Pyx_GOTREF(__pyx_t_1);
13177 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
13178 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13192 __Pyx_XDECREF(__pyx_t_1);
13193 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13196 __Pyx_TraceReturn(Py_None, 0);
13197 __Pyx_RefNannyFinishContext();
13208 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13209 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
13210 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13211 PyObject *__pyx_r = 0;
13212 __Pyx_RefNannyDeclarations
13213 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
13214 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
13217 __Pyx_RefNannyFinishContext();
13221 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
13222 PyObject *__pyx_r = NULL;
13223 __Pyx_TraceDeclarations
13224 __Pyx_RefNannyDeclarations
13225 PyObject *__pyx_t_1 = NULL;
13226 int __pyx_lineno = 0;
13227 const char *__pyx_filename = NULL;
13228 int __pyx_clineno = 0;
13229 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
13230 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13238 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
13239 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13240 __Pyx_GOTREF(__pyx_t_1);
13241 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13243 __PYX_ERR(1, 2, __pyx_L1_error)
13253 __Pyx_XDECREF(__pyx_t_1);
13254 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13256 __Pyx_XGIVEREF(__pyx_r);
13257 __Pyx_TraceReturn(__pyx_r, 0);
13258 __Pyx_RefNannyFinishContext();
13270 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
13271 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
13272 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13273 PyObject *__pyx_r = 0;
13274 __Pyx_RefNannyDeclarations
13275 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
13276 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13279 __Pyx_RefNannyFinishContext();
13283 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13284 PyObject *__pyx_r = NULL;
13285 __Pyx_TraceDeclarations
13286 __Pyx_RefNannyDeclarations
13287 PyObject *__pyx_t_1 = NULL;
13288 int __pyx_lineno = 0;
13289 const char *__pyx_filename = NULL;
13290 int __pyx_clineno = 0;
13291 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
13292 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
13299 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
13300 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13301 __Pyx_GOTREF(__pyx_t_1);
13302 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13303 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13304 __PYX_ERR(1, 4, __pyx_L1_error)
13315 __Pyx_XDECREF(__pyx_t_1);
13316 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13318 __Pyx_XGIVEREF(__pyx_r);
13319 __Pyx_TraceReturn(__pyx_r, 0);
13320 __Pyx_RefNannyFinishContext();
13332 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
13333 struct __pyx_array_obj *__pyx_v_result = 0;
13334 struct __pyx_array_obj *__pyx_r = NULL;
13335 __Pyx_TraceDeclarations
13336 __Pyx_RefNannyDeclarations
13338 PyObject *__pyx_t_2 = NULL;
13339 PyObject *__pyx_t_3 = NULL;
13340 PyObject *__pyx_t_4 = NULL;
13341 PyObject *__pyx_t_5 = NULL;
13342 int __pyx_lineno = 0;
13343 const char *__pyx_filename = NULL;
13344 int __pyx_clineno = 0;
13345 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
13346 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 245, 0, __PYX_ERR(1, 245, __pyx_L1_error));
13355 __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
13356 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
13366 __Pyx_TraceLine(250,0,__PYX_ERR(1, 250, __pyx_L1_error))
13367 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
13368 __Pyx_GOTREF(__pyx_t_2);
13369 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
13370 __Pyx_GOTREF(__pyx_t_3);
13371 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
13372 __Pyx_GOTREF(__pyx_t_4);
13373 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
13374 __Pyx_GOTREF(__pyx_t_5);
13375 __Pyx_INCREF(__pyx_v_shape);
13376 __Pyx_GIVEREF(__pyx_v_shape);
13377 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
13378 __Pyx_GIVEREF(__pyx_t_2);
13379 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
13380 __Pyx_GIVEREF(__pyx_t_3);
13381 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
13382 __Pyx_GIVEREF(__pyx_t_4);
13383 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
13387 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
13388 __Pyx_GOTREF(__pyx_t_4);
13389 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13390 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
13410 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
13412 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
13413 __Pyx_GOTREF(__pyx_t_4);
13414 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
13415 __Pyx_GOTREF(__pyx_t_5);
13416 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
13417 __Pyx_GOTREF(__pyx_t_3);
13418 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
13419 __Pyx_GOTREF(__pyx_t_2);
13420 __Pyx_INCREF(__pyx_v_shape);
13421 __Pyx_GIVEREF(__pyx_v_shape);
13422 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
13423 __Pyx_GIVEREF(__pyx_t_4);
13424 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
13425 __Pyx_GIVEREF(__pyx_t_5);
13426 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
13427 __Pyx_GIVEREF(__pyx_t_3);
13428 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
13440 __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
13441 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
13442 __Pyx_GOTREF(__pyx_t_3);
13443 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
13452 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
13453 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
13454 __Pyx_GOTREF(__pyx_t_5);
13455 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13456 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13457 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
13467 __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error))
13468 __pyx_v_result->data = __pyx_v_buf;
13479 __Pyx_TraceLine(256,0,__PYX_ERR(1, 256, __pyx_L1_error))
13480 __Pyx_XDECREF(((PyObject *)__pyx_r));
13481 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13482 __pyx_r = __pyx_v_result;
13495 __Pyx_XDECREF(__pyx_t_2);
13496 __Pyx_XDECREF(__pyx_t_3);
13497 __Pyx_XDECREF(__pyx_t_4);
13498 __Pyx_XDECREF(__pyx_t_5);
13499 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13502 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13503 __Pyx_XGIVEREF((PyObject *)__pyx_r);
13504 __Pyx_TraceReturn(__pyx_r, 0);
13505 __Pyx_RefNannyFinishContext();
13518 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13519 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13520 PyObject *__pyx_v_name = 0;
13521 int __pyx_lineno = 0;
13522 const char *__pyx_filename = NULL;
13523 int __pyx_clineno = 0;
13525 __Pyx_RefNannyDeclarations
13526 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
13528 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
13529 PyObject* values[1] = {0};
13530 if (unlikely(__pyx_kwds)) {
13531 Py_ssize_t kw_args;
13532 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13533 switch (pos_args) {
13534 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13535 CYTHON_FALLTHROUGH;
13537 default:
goto __pyx_L5_argtuple_error;
13539 kw_args = PyDict_Size(__pyx_kwds);
13540 switch (pos_args) {
13542 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
13543 else goto __pyx_L5_argtuple_error;
13545 if (unlikely(kw_args > 0)) {
13546 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
13548 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
13549 goto __pyx_L5_argtuple_error;
13551 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13553 __pyx_v_name = values[0];
13555 goto __pyx_L4_argument_unpacking_done;
13556 __pyx_L5_argtuple_error:;
13557 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
13559 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13560 __Pyx_RefNannyFinishContext();
13562 __pyx_L4_argument_unpacking_done:;
13563 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
13566 __Pyx_RefNannyFinishContext();
13570 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
13572 __Pyx_TraceDeclarations
13573 __Pyx_RefNannyDeclarations
13574 int __pyx_lineno = 0;
13575 const char *__pyx_filename = NULL;
13576 int __pyx_clineno = 0;
13577 __Pyx_RefNannySetupContext(
"__init__", 0);
13578 __Pyx_TraceCall(
"__init__", __pyx_f[1], 282, 0, __PYX_ERR(1, 282, __pyx_L1_error));
13587 __Pyx_TraceLine(283,0,__PYX_ERR(1, 283, __pyx_L1_error))
13588 __Pyx_INCREF(__pyx_v_name);
13589 __Pyx_GIVEREF(__pyx_v_name);
13590 __Pyx_GOTREF(__pyx_v_self->name);
13591 __Pyx_DECREF(__pyx_v_self->name);
13592 __pyx_v_self->name = __pyx_v_name;
13606 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13609 __Pyx_TraceReturn(Py_None, 0);
13610 __Pyx_RefNannyFinishContext();
13623 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
13624 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
13625 PyObject *__pyx_r = 0;
13626 __Pyx_RefNannyDeclarations
13627 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
13628 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
13631 __Pyx_RefNannyFinishContext();
13635 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
13636 PyObject *__pyx_r = NULL;
13637 __Pyx_TraceDeclarations
13638 __Pyx_RefNannyDeclarations
13639 int __pyx_lineno = 0;
13640 const char *__pyx_filename = NULL;
13641 int __pyx_clineno = 0;
13642 __Pyx_RefNannySetupContext(
"__repr__", 0);
13643 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 284, 0, __PYX_ERR(1, 284, __pyx_L1_error));
13652 __Pyx_TraceLine(285,0,__PYX_ERR(1, 285, __pyx_L1_error))
13653 __Pyx_XDECREF(__pyx_r);
13654 __Pyx_INCREF(__pyx_v_self->name);
13655 __pyx_r = __pyx_v_self->name;
13668 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13671 __Pyx_XGIVEREF(__pyx_r);
13672 __Pyx_TraceReturn(__pyx_r, 0);
13673 __Pyx_RefNannyFinishContext();
13684 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13685 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
13686 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13687 PyObject *__pyx_r = 0;
13688 __Pyx_RefNannyDeclarations
13689 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
13690 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
13693 __Pyx_RefNannyFinishContext();
13697 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
13698 PyObject *__pyx_v_state = 0;
13699 PyObject *__pyx_v__dict = 0;
13700 int __pyx_v_use_setstate;
13701 PyObject *__pyx_r = NULL;
13702 __Pyx_TraceDeclarations
13703 __Pyx_RefNannyDeclarations
13704 PyObject *__pyx_t_1 = NULL;
13707 PyObject *__pyx_t_4 = NULL;
13708 PyObject *__pyx_t_5 = NULL;
13709 int __pyx_lineno = 0;
13710 const char *__pyx_filename = NULL;
13711 int __pyx_clineno = 0;
13712 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
13713 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13722 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
13723 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
13724 __Pyx_GOTREF(__pyx_t_1);
13725 __Pyx_INCREF(__pyx_v_self->name);
13726 __Pyx_GIVEREF(__pyx_v_self->name);
13727 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
13728 __pyx_v_state = ((PyObject*)__pyx_t_1);
13738 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
13739 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
13740 __Pyx_GOTREF(__pyx_t_1);
13741 __pyx_v__dict = __pyx_t_1;
13751 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
13752 __pyx_t_2 = (__pyx_v__dict != Py_None);
13753 __pyx_t_3 = (__pyx_t_2 != 0);
13763 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
13764 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
13765 __Pyx_GOTREF(__pyx_t_1);
13766 __Pyx_INCREF(__pyx_v__dict);
13767 __Pyx_GIVEREF(__pyx_v__dict);
13768 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
13769 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
13770 __Pyx_GOTREF(__pyx_t_4);
13771 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13772 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
13782 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
13783 __pyx_v_use_setstate = 1;
13802 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
13804 __pyx_t_3 = (__pyx_v_self->name != Py_None);
13805 __pyx_v_use_setstate = __pyx_t_3;
13816 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
13817 __pyx_t_3 = (__pyx_v_use_setstate != 0);
13827 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
13828 __Pyx_XDECREF(__pyx_r);
13829 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
13830 __Pyx_GOTREF(__pyx_t_4);
13831 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
13832 __Pyx_GOTREF(__pyx_t_1);
13833 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13834 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13835 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13836 __Pyx_INCREF(__pyx_int_184977713);
13837 __Pyx_GIVEREF(__pyx_int_184977713);
13838 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
13839 __Pyx_INCREF(Py_None);
13840 __Pyx_GIVEREF(Py_None);
13841 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
13842 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
13843 __Pyx_GOTREF(__pyx_t_5);
13844 __Pyx_GIVEREF(__pyx_t_4);
13845 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13846 __Pyx_GIVEREF(__pyx_t_1);
13847 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
13848 __Pyx_INCREF(__pyx_v_state);
13849 __Pyx_GIVEREF(__pyx_v_state);
13850 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
13853 __pyx_r = __pyx_t_5;
13873 __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
13875 __Pyx_XDECREF(__pyx_r);
13876 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
13877 __Pyx_GOTREF(__pyx_t_5);
13878 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
13879 __Pyx_GOTREF(__pyx_t_1);
13880 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13881 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13882 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13883 __Pyx_INCREF(__pyx_int_184977713);
13884 __Pyx_GIVEREF(__pyx_int_184977713);
13885 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
13886 __Pyx_INCREF(__pyx_v_state);
13887 __Pyx_GIVEREF(__pyx_v_state);
13888 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
13889 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
13890 __Pyx_GOTREF(__pyx_t_4);
13891 __Pyx_GIVEREF(__pyx_t_5);
13892 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
13893 __Pyx_GIVEREF(__pyx_t_1);
13894 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
13897 __pyx_r = __pyx_t_4;
13910 __Pyx_XDECREF(__pyx_t_1);
13911 __Pyx_XDECREF(__pyx_t_4);
13912 __Pyx_XDECREF(__pyx_t_5);
13913 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13916 __Pyx_XDECREF(__pyx_v_state);
13917 __Pyx_XDECREF(__pyx_v__dict);
13918 __Pyx_XGIVEREF(__pyx_r);
13919 __Pyx_TraceReturn(__pyx_r, 0);
13920 __Pyx_RefNannyFinishContext();
13932 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
13933 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
13934 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13935 PyObject *__pyx_r = 0;
13936 __Pyx_RefNannyDeclarations
13937 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
13938 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13941 __Pyx_RefNannyFinishContext();
13945 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13946 PyObject *__pyx_r = NULL;
13947 __Pyx_TraceDeclarations
13948 __Pyx_RefNannyDeclarations
13949 PyObject *__pyx_t_1 = NULL;
13950 int __pyx_lineno = 0;
13951 const char *__pyx_filename = NULL;
13952 int __pyx_clineno = 0;
13953 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
13954 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
13961 __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
13962 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
13963 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
13964 __Pyx_GOTREF(__pyx_t_1);
13965 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13975 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13978 __Pyx_XDECREF(__pyx_t_1);
13979 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13982 __Pyx_XGIVEREF(__pyx_r);
13983 __Pyx_TraceReturn(__pyx_r, 0);
13984 __Pyx_RefNannyFinishContext();
13996 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
13997 Py_intptr_t __pyx_v_aligned_p;
13998 size_t __pyx_v_offset;
14000 __Pyx_TraceDeclarations
14002 int __pyx_lineno = 0;
14003 const char *__pyx_filename = NULL;
14004 int __pyx_clineno = 0;
14005 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 299, 1, __PYX_ERR(1, 299, __pyx_L1_error));
14014 __Pyx_TraceLine(301,1,__PYX_ERR(1, 301, __pyx_L1_error))
14015 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
14024 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
14033 __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
14034 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
14044 __Pyx_TraceLine(308,1,__PYX_ERR(1, 308, __pyx_L1_error))
14045 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
14063 __Pyx_TraceLine(310,1,__PYX_ERR(1, 310, __pyx_L1_error))
14064 __pyx_r = ((
void *)__pyx_v_aligned_p);
14077 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
14080 __Pyx_TraceReturn(Py_None, 1);
14093 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14094 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14095 PyObject *__pyx_v_obj = 0;
14097 int __pyx_v_dtype_is_object;
14098 int __pyx_lineno = 0;
14099 const char *__pyx_filename = NULL;
14100 int __pyx_clineno = 0;
14102 __Pyx_RefNannyDeclarations
14103 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
14105 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
14106 PyObject* values[3] = {0,0,0};
14107 if (unlikely(__pyx_kwds)) {
14108 Py_ssize_t kw_args;
14109 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14110 switch (pos_args) {
14111 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14112 CYTHON_FALLTHROUGH;
14113 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14114 CYTHON_FALLTHROUGH;
14115 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14116 CYTHON_FALLTHROUGH;
14118 default:
goto __pyx_L5_argtuple_error;
14120 kw_args = PyDict_Size(__pyx_kwds);
14121 switch (pos_args) {
14123 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14124 else goto __pyx_L5_argtuple_error;
14125 CYTHON_FALLTHROUGH;
14127 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
14129 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
14131 CYTHON_FALLTHROUGH;
14134 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
14135 if (value) { values[2] = value; kw_args--; }
14138 if (unlikely(kw_args > 0)) {
14139 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
14142 switch (PyTuple_GET_SIZE(__pyx_args)) {
14143 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14144 CYTHON_FALLTHROUGH;
14145 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14146 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14148 default:
goto __pyx_L5_argtuple_error;
14151 __pyx_v_obj = values[0];
14152 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
14154 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
14156 __pyx_v_dtype_is_object = ((int)0);
14159 goto __pyx_L4_argument_unpacking_done;
14160 __pyx_L5_argtuple_error:;
14161 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
14163 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14164 __Pyx_RefNannyFinishContext();
14166 __pyx_L4_argument_unpacking_done:;
14167 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
14170 __Pyx_RefNannyFinishContext();
14174 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
14176 __Pyx_TraceDeclarations
14177 __Pyx_RefNannyDeclarations
14182 int __pyx_lineno = 0;
14183 const char *__pyx_filename = NULL;
14184 int __pyx_clineno = 0;
14185 __Pyx_RefNannySetupContext(
"__cinit__", 0);
14186 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 346, 0, __PYX_ERR(1, 346, __pyx_L1_error));
14195 __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
14196 __Pyx_INCREF(__pyx_v_obj);
14197 __Pyx_GIVEREF(__pyx_v_obj);
14198 __Pyx_GOTREF(__pyx_v_self->obj);
14199 __Pyx_DECREF(__pyx_v_self->obj);
14200 __pyx_v_self->obj = __pyx_v_obj;
14209 __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
14210 __pyx_v_self->flags = __pyx_v_flags;
14219 __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
14220 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
14221 __pyx_t_3 = (__pyx_t_2 != 0);
14224 __pyx_t_1 = __pyx_t_3;
14225 goto __pyx_L4_bool_binop_done;
14227 __pyx_t_3 = (__pyx_v_obj != Py_None);
14228 __pyx_t_2 = (__pyx_t_3 != 0);
14229 __pyx_t_1 = __pyx_t_2;
14230 __pyx_L4_bool_binop_done:;
14240 __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
14241 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
14250 __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
14251 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
14261 __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
14262 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
14271 __Pyx_TraceLine(353,0,__PYX_ERR(1, 353, __pyx_L1_error))
14272 Py_INCREF(Py_None);
14299 __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
14300 __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
14310 __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
14311 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
14321 __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
14322 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
14331 __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
14332 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
14350 __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
14351 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
14361 __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
14362 __pyx_v_self->lock = PyThread_allocate_lock();
14371 __Pyx_TraceLine(362,0,__PYX_ERR(1, 362, __pyx_L1_error))
14372 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
14373 if (unlikely(__pyx_t_1)) {
14382 __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
14383 PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
14419 __Pyx_TraceLine(365,0,__PYX_ERR(1, 365, __pyx_L1_error))
14420 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
14430 __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
14431 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
14434 __pyx_t_1 = __pyx_t_2;
14435 goto __pyx_L12_bool_binop_done;
14437 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
14438 __pyx_t_1 = __pyx_t_2;
14439 __pyx_L12_bool_binop_done:;
14440 __pyx_v_self->dtype_is_object = __pyx_t_1;
14459 __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
14461 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
14472 __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
14473 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
14482 __Pyx_TraceLine(372,0,__PYX_ERR(1, 372, __pyx_L1_error))
14483 __pyx_v_self->typeinfo = NULL;
14497 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14500 __Pyx_TraceReturn(Py_None, 0);
14501 __Pyx_RefNannyFinishContext();
14514 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
14515 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
14516 __Pyx_RefNannyDeclarations
14517 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
14518 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14521 __Pyx_RefNannyFinishContext();
14524 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14526 __Pyx_TraceDeclarations
14527 __Pyx_RefNannyDeclarations
14533 PyThread_type_lock __pyx_t_6;
14534 PyThread_type_lock __pyx_t_7;
14535 int __pyx_lineno = 0;
14536 const char *__pyx_filename = NULL;
14537 int __pyx_clineno = 0;
14538 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
14539 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 374, 0, __PYX_ERR(1, 374, __pyx_L1_error));
14548 __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
14549 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
14550 __pyx_t_2 = (__pyx_t_1 != 0);
14560 __Pyx_TraceLine(376,0,__PYX_ERR(1, 376, __pyx_L1_error))
14561 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
14580 __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
14581 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
14591 __Pyx_TraceLine(379,0,__PYX_ERR(1, 379, __pyx_L1_error))
14592 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
14601 __Pyx_TraceLine(380,0,__PYX_ERR(1, 380, __pyx_L1_error))
14602 Py_DECREF(Py_None);
14621 __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
14622 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
14632 __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
14633 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
14634 __pyx_t_4 = __pyx_t_3;
14635 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
14636 __pyx_v_i = __pyx_t_5;
14645 __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
14646 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
14656 __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
14657 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
14666 __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
14667 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
14677 __Pyx_TraceLine(390,0,__PYX_ERR(1, 390, __pyx_L1_error))
14678 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
14679 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
14688 __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
14689 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
14690 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
14708 __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
14709 goto __pyx_L6_break;
14729 __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
14730 PyThread_free_lock(__pyx_v_self->lock);
14754 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14756 __Pyx_TraceReturn(Py_None, 0);
14757 __Pyx_RefNannyFinishContext();
14768 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
14769 Py_ssize_t __pyx_v_dim;
14770 char *__pyx_v_itemp;
14771 PyObject *__pyx_v_idx = NULL;
14773 __Pyx_TraceDeclarations
14774 __Pyx_RefNannyDeclarations
14775 Py_ssize_t __pyx_t_1;
14776 PyObject *__pyx_t_2 = NULL;
14777 Py_ssize_t __pyx_t_3;
14778 PyObject *(*__pyx_t_4)(PyObject *);
14779 PyObject *__pyx_t_5 = NULL;
14780 Py_ssize_t __pyx_t_6;
14782 int __pyx_lineno = 0;
14783 const char *__pyx_filename = NULL;
14784 int __pyx_clineno = 0;
14785 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
14786 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 395, 0, __PYX_ERR(1, 395, __pyx_L1_error));
14795 __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
14796 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
14805 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
14807 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
14808 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
14811 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
14812 __Pyx_GOTREF(__pyx_t_2);
14813 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
14816 if (likely(!__pyx_t_4)) {
14817 if (likely(PyList_CheckExact(__pyx_t_2))) {
14818 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
14819 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14820 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
14822 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
14823 __Pyx_GOTREF(__pyx_t_5);
14826 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
14827 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14828 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
14830 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
14831 __Pyx_GOTREF(__pyx_t_5);
14835 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
14836 if (unlikely(!__pyx_t_5)) {
14837 PyObject* exc_type = PyErr_Occurred();
14839 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14840 else __PYX_ERR(1, 399, __pyx_L1_error)
14844 __Pyx_GOTREF(__pyx_t_5);
14846 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
14848 __pyx_v_dim = __pyx_t_1;
14849 __pyx_t_1 = (__pyx_t_1 + 1);
14858 __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
14859 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
14860 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
14861 __pyx_v_itemp = __pyx_t_7;
14870 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
14872 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14881 __Pyx_TraceLine(402,0,__PYX_ERR(1, 402, __pyx_L1_error))
14882 __pyx_r = __pyx_v_itemp;
14895 __Pyx_XDECREF(__pyx_t_2);
14896 __Pyx_XDECREF(__pyx_t_5);
14897 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
14900 __Pyx_XDECREF(__pyx_v_idx);
14901 __Pyx_TraceReturn(Py_None, 0);
14902 __Pyx_RefNannyFinishContext();
14915 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
14916 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
14917 PyObject *__pyx_r = 0;
14918 __Pyx_RefNannyDeclarations
14919 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
14920 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
14923 __Pyx_RefNannyFinishContext();
14927 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
14928 PyObject *__pyx_v_have_slices = NULL;
14929 PyObject *__pyx_v_indices = NULL;
14930 char *__pyx_v_itemp;
14931 PyObject *__pyx_r = NULL;
14932 __Pyx_TraceDeclarations
14933 __Pyx_RefNannyDeclarations
14936 PyObject *__pyx_t_3 = NULL;
14937 PyObject *__pyx_t_4 = NULL;
14938 PyObject *__pyx_t_5 = NULL;
14940 int __pyx_lineno = 0;
14941 const char *__pyx_filename = NULL;
14942 int __pyx_clineno = 0;
14943 __Pyx_RefNannySetupContext(
"__getitem__", 0);
14944 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 405, 0, __PYX_ERR(1, 405, __pyx_L1_error));
14953 __Pyx_TraceLine(406,0,__PYX_ERR(1, 406, __pyx_L1_error))
14954 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
14955 __pyx_t_2 = (__pyx_t_1 != 0);
14965 __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
14966 __Pyx_XDECREF(__pyx_r);
14967 __Pyx_INCREF(((PyObject *)__pyx_v_self));
14968 __pyx_r = ((PyObject *)__pyx_v_self);
14987 __Pyx_TraceLine(409,0,__PYX_ERR(1, 409, __pyx_L1_error))
14988 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
14989 __Pyx_GOTREF(__pyx_t_3);
14990 if (likely(__pyx_t_3 != Py_None)) {
14991 PyObject* sequence = __pyx_t_3;
14992 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14993 if (unlikely(size != 2)) {
14994 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14995 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14996 __PYX_ERR(1, 409, __pyx_L1_error)
14998 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14999 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
15000 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
15001 __Pyx_INCREF(__pyx_t_4);
15002 __Pyx_INCREF(__pyx_t_5);
15004 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
15005 __Pyx_GOTREF(__pyx_t_4);
15006 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
15007 __Pyx_GOTREF(__pyx_t_5);
15009 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15011 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
15013 __pyx_v_have_slices = __pyx_t_4;
15015 __pyx_v_indices = __pyx_t_5;
15025 __Pyx_TraceLine(412,0,__PYX_ERR(1, 412, __pyx_L1_error))
15026 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
15036 __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
15037 __Pyx_XDECREF(__pyx_r);
15038 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
15039 __Pyx_GOTREF(__pyx_t_3);
15040 __pyx_r = __pyx_t_3;
15060 __Pyx_TraceLine(415,0,__PYX_ERR(1, 415, __pyx_L1_error))
15062 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
15063 __pyx_v_itemp = __pyx_t_6;
15072 __Pyx_TraceLine(416,0,__PYX_ERR(1, 416, __pyx_L1_error))
15073 __Pyx_XDECREF(__pyx_r);
15074 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
15075 __Pyx_GOTREF(__pyx_t_3);
15076 __pyx_r = __pyx_t_3;
15091 __Pyx_XDECREF(__pyx_t_3);
15092 __Pyx_XDECREF(__pyx_t_4);
15093 __Pyx_XDECREF(__pyx_t_5);
15094 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15097 __Pyx_XDECREF(__pyx_v_have_slices);
15098 __Pyx_XDECREF(__pyx_v_indices);
15099 __Pyx_XGIVEREF(__pyx_r);
15100 __Pyx_TraceReturn(__pyx_r, 0);
15101 __Pyx_RefNannyFinishContext();
15114 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
15115 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
15117 __Pyx_RefNannyDeclarations
15118 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
15119 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
15122 __Pyx_RefNannyFinishContext();
15126 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
15127 PyObject *__pyx_v_have_slices = NULL;
15128 PyObject *__pyx_v_obj = NULL;
15130 __Pyx_TraceDeclarations
15131 __Pyx_RefNannyDeclarations
15133 PyObject *__pyx_t_2 = NULL;
15134 PyObject *__pyx_t_3 = NULL;
15135 PyObject *__pyx_t_4 = NULL;
15136 int __pyx_lineno = 0;
15137 const char *__pyx_filename = NULL;
15138 int __pyx_clineno = 0;
15139 __Pyx_RefNannySetupContext(
"__setitem__", 0);
15140 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 418, 0, __PYX_ERR(1, 418, __pyx_L1_error));
15141 __Pyx_INCREF(__pyx_v_index);
15150 __Pyx_TraceLine(419,0,__PYX_ERR(1, 419, __pyx_L1_error))
15151 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
15152 if (unlikely(__pyx_t_1)) {
15161 __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
15162 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
15163 __Pyx_GOTREF(__pyx_t_2);
15164 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
15165 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15166 __PYX_ERR(1, 420, __pyx_L1_error)
15184 __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
15185 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
15186 __Pyx_GOTREF(__pyx_t_2);
15187 if (likely(__pyx_t_2 != Py_None)) {
15188 PyObject* sequence = __pyx_t_2;
15189 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
15190 if (unlikely(size != 2)) {
15191 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
15192 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
15193 __PYX_ERR(1, 422, __pyx_L1_error)
15195 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15196 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
15197 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
15198 __Pyx_INCREF(__pyx_t_3);
15199 __Pyx_INCREF(__pyx_t_4);
15201 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
15202 __Pyx_GOTREF(__pyx_t_3);
15203 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
15204 __Pyx_GOTREF(__pyx_t_4);
15206 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15208 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
15210 __pyx_v_have_slices = __pyx_t_3;
15212 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
15222 __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
15223 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
15233 __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
15234 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
15235 __Pyx_GOTREF(__pyx_t_2);
15236 __pyx_v_obj = __pyx_t_2;
15246 __Pyx_TraceLine(426,0,__PYX_ERR(1, 426, __pyx_L1_error))
15247 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
15257 __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
15258 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
15259 __Pyx_GOTREF(__pyx_t_2);
15260 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
15261 __Pyx_GOTREF(__pyx_t_4);
15262 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15263 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15282 __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
15284 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
15285 __Pyx_GOTREF(__pyx_t_4);
15286 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
15287 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
15288 __Pyx_GOTREF(__pyx_t_2);
15289 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15290 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15311 __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
15313 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
15314 __Pyx_GOTREF(__pyx_t_2);
15315 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15331 __Pyx_XDECREF(__pyx_t_2);
15332 __Pyx_XDECREF(__pyx_t_3);
15333 __Pyx_XDECREF(__pyx_t_4);
15334 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15337 __Pyx_XDECREF(__pyx_v_have_slices);
15338 __Pyx_XDECREF(__pyx_v_obj);
15339 __Pyx_XDECREF(__pyx_v_index);
15340 __Pyx_TraceReturn(Py_None, 0);
15341 __Pyx_RefNannyFinishContext();
15353 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
15354 PyObject *__pyx_r = NULL;
15355 __Pyx_TraceDeclarations
15356 __Pyx_RefNannyDeclarations
15359 PyObject *__pyx_t_3 = NULL;
15360 PyObject *__pyx_t_4 = NULL;
15361 PyObject *__pyx_t_5 = NULL;
15362 PyObject *__pyx_t_6 = NULL;
15363 PyObject *__pyx_t_7 = NULL;
15364 PyObject *__pyx_t_8 = NULL;
15366 int __pyx_lineno = 0;
15367 const char *__pyx_filename = NULL;
15368 int __pyx_clineno = 0;
15369 __Pyx_RefNannySetupContext(
"is_slice", 0);
15370 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 433, 0, __PYX_ERR(1, 433, __pyx_L1_error));
15371 __Pyx_INCREF(__pyx_v_obj);
15380 __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L1_error))
15381 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
15382 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15392 __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L1_error))
15394 __Pyx_PyThreadState_declare
15395 __Pyx_PyThreadState_assign
15396 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
15397 __Pyx_XGOTREF(__pyx_t_3);
15398 __Pyx_XGOTREF(__pyx_t_4);
15399 __Pyx_XGOTREF(__pyx_t_5);
15409 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
15410 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
15411 __Pyx_GOTREF(__pyx_t_6);
15420 __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L4_error))
15421 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
15422 __Pyx_GOTREF(__pyx_t_7);
15431 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
15432 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
15433 __Pyx_GOTREF(__pyx_t_8);
15434 __Pyx_INCREF(__pyx_v_obj);
15435 __Pyx_GIVEREF(__pyx_v_obj);
15436 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
15437 __Pyx_GIVEREF(__pyx_t_6);
15438 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
15439 __Pyx_GIVEREF(__pyx_t_7);
15440 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
15443 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
15444 __Pyx_GOTREF(__pyx_t_7);
15445 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15446 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
15457 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15458 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15459 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15460 goto __pyx_L9_try_end;
15462 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15463 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15464 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15473 __Pyx_TraceLine(438,0,__PYX_ERR(1, 438, __pyx_L6_except_error))
15474 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
15476 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15477 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
15478 __Pyx_GOTREF(__pyx_t_7);
15479 __Pyx_GOTREF(__pyx_t_8);
15480 __Pyx_GOTREF(__pyx_t_6);
15489 __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L6_except_error))
15490 __Pyx_XDECREF(__pyx_r);
15491 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15492 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15493 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15494 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15495 goto __pyx_L7_except_return;
15497 goto __pyx_L6_except_error;
15498 __pyx_L6_except_error:;
15507 __Pyx_XGIVEREF(__pyx_t_3);
15508 __Pyx_XGIVEREF(__pyx_t_4);
15509 __Pyx_XGIVEREF(__pyx_t_5);
15510 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15511 goto __pyx_L1_error;
15512 __pyx_L7_except_return:;
15513 __Pyx_XGIVEREF(__pyx_t_3);
15514 __Pyx_XGIVEREF(__pyx_t_4);
15515 __Pyx_XGIVEREF(__pyx_t_5);
15516 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15537 __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
15538 __Pyx_XDECREF(__pyx_r);
15539 __Pyx_INCREF(__pyx_v_obj);
15540 __pyx_r = __pyx_v_obj;
15553 __Pyx_XDECREF(__pyx_t_6);
15554 __Pyx_XDECREF(__pyx_t_7);
15555 __Pyx_XDECREF(__pyx_t_8);
15556 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15559 __Pyx_XDECREF(__pyx_v_obj);
15560 __Pyx_XGIVEREF(__pyx_r);
15561 __Pyx_TraceReturn(__pyx_r, 0);
15562 __Pyx_RefNannyFinishContext();
15574 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
15575 __Pyx_memviewslice __pyx_v_dst_slice;
15576 __Pyx_memviewslice __pyx_v_src_slice;
15577 PyObject *__pyx_r = NULL;
15578 __Pyx_TraceDeclarations
15579 __Pyx_RefNannyDeclarations
15580 __Pyx_memviewslice *__pyx_t_1;
15581 __Pyx_memviewslice *__pyx_t_2;
15582 PyObject *__pyx_t_3 = NULL;
15586 int __pyx_lineno = 0;
15587 const char *__pyx_filename = NULL;
15588 int __pyx_clineno = 0;
15589 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
15590 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 443, 0, __PYX_ERR(1, 443, __pyx_L1_error));
15599 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
15600 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
15601 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
15610 __Pyx_TraceLine(448,0,__PYX_ERR(1, 448, __pyx_L1_error))
15611 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
15612 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
15621 __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
15622 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
15623 __Pyx_GOTREF(__pyx_t_3);
15624 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
15625 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15626 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
15627 __Pyx_GOTREF(__pyx_t_3);
15628 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
15629 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15638 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
15639 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
15650 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15653 __Pyx_XDECREF(__pyx_t_3);
15654 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
15657 __Pyx_XGIVEREF(__pyx_r);
15658 __Pyx_TraceReturn(__pyx_r, 0);
15659 __Pyx_RefNannyFinishContext();
15671 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
15672 int __pyx_v_array[0x80];
15674 void *__pyx_v_item;
15675 __Pyx_memviewslice *__pyx_v_dst_slice;
15676 __Pyx_memviewslice __pyx_v_tmp_slice;
15677 PyObject *__pyx_r = NULL;
15678 __Pyx_TraceDeclarations
15679 __Pyx_RefNannyDeclarations
15680 __Pyx_memviewslice *__pyx_t_1;
15682 PyObject *__pyx_t_3 = NULL;
15685 char const *__pyx_t_6;
15686 PyObject *__pyx_t_7 = NULL;
15687 PyObject *__pyx_t_8 = NULL;
15688 PyObject *__pyx_t_9 = NULL;
15689 PyObject *__pyx_t_10 = NULL;
15690 PyObject *__pyx_t_11 = NULL;
15691 PyObject *__pyx_t_12 = NULL;
15692 int __pyx_lineno = 0;
15693 const char *__pyx_filename = NULL;
15694 int __pyx_clineno = 0;
15695 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
15696 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 451, 0, __PYX_ERR(1, 451, __pyx_L1_error));
15705 __Pyx_TraceLine(453,0,__PYX_ERR(1, 453, __pyx_L1_error))
15706 __pyx_v_tmp = NULL;
15715 __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
15716 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
15717 __pyx_v_dst_slice = __pyx_t_1;
15726 __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
15727 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
15737 __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
15738 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
15747 __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
15748 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
15749 if (unlikely(__pyx_t_2)) {
15758 __Pyx_TraceLine(463,0,__PYX_ERR(1, 463, __pyx_L1_error))
15759 PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
15777 __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
15778 __pyx_v_item = __pyx_v_tmp;
15797 __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
15799 __pyx_v_item = ((
void *)__pyx_v_array);
15810 __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L1_error))
15820 __Pyx_TraceLine(469,0,__PYX_ERR(1, 469, __pyx_L6_error))
15821 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
15831 __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
15832 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
15851 __Pyx_TraceLine(472,0,__PYX_ERR(1, 472, __pyx_L6_error))
15853 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
15854 __Pyx_GOTREF(__pyx_t_3);
15855 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15866 __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
15867 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
15877 __Pyx_TraceLine(477,0,__PYX_ERR(1, 477, __pyx_L6_error))
15878 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
15879 __Pyx_GOTREF(__pyx_t_3);
15880 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15898 __Pyx_TraceLine(478,0,__PYX_ERR(1, 478, __pyx_L6_error))
15899 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
15909 __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L6_error))
15912 PyMem_Free(__pyx_v_tmp);
15917 __Pyx_PyThreadState_declare
15918 __Pyx_PyThreadState_assign
15919 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
15920 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15921 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
15922 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
15923 __Pyx_XGOTREF(__pyx_t_7);
15924 __Pyx_XGOTREF(__pyx_t_8);
15925 __Pyx_XGOTREF(__pyx_t_9);
15926 __Pyx_XGOTREF(__pyx_t_10);
15927 __Pyx_XGOTREF(__pyx_t_11);
15928 __Pyx_XGOTREF(__pyx_t_12);
15929 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
15931 PyMem_Free(__pyx_v_tmp);
15933 if (PY_MAJOR_VERSION >= 3) {
15934 __Pyx_XGIVEREF(__pyx_t_10);
15935 __Pyx_XGIVEREF(__pyx_t_11);
15936 __Pyx_XGIVEREF(__pyx_t_12);
15937 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
15939 __Pyx_XGIVEREF(__pyx_t_7);
15940 __Pyx_XGIVEREF(__pyx_t_8);
15941 __Pyx_XGIVEREF(__pyx_t_9);
15942 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
15943 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
15944 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
15945 goto __pyx_L1_error;
15959 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15962 __Pyx_XDECREF(__pyx_t_3);
15963 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
15966 __Pyx_XGIVEREF(__pyx_r);
15967 __Pyx_TraceReturn(__pyx_r, 0);
15968 __Pyx_RefNannyFinishContext();
15980 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
15981 char *__pyx_v_itemp;
15982 PyObject *__pyx_r = NULL;
15983 __Pyx_TraceDeclarations
15984 __Pyx_RefNannyDeclarations
15986 PyObject *__pyx_t_2 = NULL;
15987 int __pyx_lineno = 0;
15988 const char *__pyx_filename = NULL;
15989 int __pyx_clineno = 0;
15990 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
15991 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 483, 0, __PYX_ERR(1, 483, __pyx_L1_error));
16000 __Pyx_TraceLine(484,0,__PYX_ERR(1, 484, __pyx_L1_error))
16001 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
16002 __pyx_v_itemp = __pyx_t_1;
16011 __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
16012 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
16013 __Pyx_GOTREF(__pyx_t_2);
16014 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16025 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16028 __Pyx_XDECREF(__pyx_t_2);
16029 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
16032 __Pyx_XGIVEREF(__pyx_r);
16033 __Pyx_TraceReturn(__pyx_r, 0);
16034 __Pyx_RefNannyFinishContext();
16046 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
16047 PyObject *__pyx_v_struct = NULL;
16048 PyObject *__pyx_v_bytesitem = 0;
16049 PyObject *__pyx_v_result = NULL;
16050 PyObject *__pyx_r = NULL;
16051 __Pyx_TraceDeclarations
16052 __Pyx_RefNannyDeclarations
16053 PyObject *__pyx_t_1 = NULL;
16054 PyObject *__pyx_t_2 = NULL;
16055 PyObject *__pyx_t_3 = NULL;
16056 PyObject *__pyx_t_4 = NULL;
16057 PyObject *__pyx_t_5 = NULL;
16058 PyObject *__pyx_t_6 = NULL;
16059 PyObject *__pyx_t_7 = NULL;
16061 PyObject *__pyx_t_9 = NULL;
16064 int __pyx_lineno = 0;
16065 const char *__pyx_filename = NULL;
16066 int __pyx_clineno = 0;
16067 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
16068 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 487, 0, __PYX_ERR(1, 487, __pyx_L1_error));
16077 __Pyx_TraceLine(490,0,__PYX_ERR(1, 490, __pyx_L1_error))
16078 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
16079 __Pyx_GOTREF(__pyx_t_1);
16080 __pyx_v_struct = __pyx_t_1;
16090 __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L1_error))
16091 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
16092 __Pyx_GOTREF(__pyx_t_1);
16093 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
16103 __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L1_error))
16105 __Pyx_PyThreadState_declare
16106 __Pyx_PyThreadState_assign
16107 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
16108 __Pyx_XGOTREF(__pyx_t_2);
16109 __Pyx_XGOTREF(__pyx_t_3);
16110 __Pyx_XGOTREF(__pyx_t_4);
16120 __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L3_error))
16121 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
16122 __Pyx_GOTREF(__pyx_t_5);
16123 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
16124 __Pyx_GOTREF(__pyx_t_6);
16127 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
16128 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
16129 if (likely(__pyx_t_7)) {
16130 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
16131 __Pyx_INCREF(__pyx_t_7);
16132 __Pyx_INCREF(
function);
16133 __Pyx_DECREF_SET(__pyx_t_5,
function);
16137 #if CYTHON_FAST_PYCALL
16138 if (PyFunction_Check(__pyx_t_5)) {
16139 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
16140 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
16141 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16142 __Pyx_GOTREF(__pyx_t_1);
16143 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16146 #if CYTHON_FAST_PYCCALL
16147 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
16148 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
16149 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
16150 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16151 __Pyx_GOTREF(__pyx_t_1);
16152 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16156 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
16157 __Pyx_GOTREF(__pyx_t_9);
16159 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
16161 __Pyx_GIVEREF(__pyx_t_6);
16162 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
16163 __Pyx_INCREF(__pyx_v_bytesitem);
16164 __Pyx_GIVEREF(__pyx_v_bytesitem);
16165 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
16167 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
16168 __Pyx_GOTREF(__pyx_t_1);
16169 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16171 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16172 __pyx_v_result = __pyx_t_1;
16191 __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
16193 __pyx_t_10 = strlen(__pyx_v_self->view.format);
16194 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
16204 __Pyx_TraceLine(500,0,__PYX_ERR(1, 500, __pyx_L5_except_error))
16205 __Pyx_XDECREF(__pyx_r);
16206 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
16207 __Pyx_GOTREF(__pyx_t_1);
16208 __pyx_r = __pyx_t_1;
16210 goto __pyx_L6_except_return;
16228 __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L5_except_error))
16229 __Pyx_XDECREF(__pyx_r);
16230 __Pyx_INCREF(__pyx_v_result);
16231 __pyx_r = __pyx_v_result;
16232 goto __pyx_L6_except_return;
16235 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16236 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16237 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16238 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16239 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16248 __Pyx_TraceLine(496,0,__PYX_ERR(1, 496, __pyx_L5_except_error))
16249 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
16250 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
16251 __Pyx_GOTREF(__pyx_t_6);
16252 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
16253 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16254 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
16255 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
16257 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16258 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
16259 __Pyx_GOTREF(__pyx_t_9);
16260 __Pyx_GOTREF(__pyx_t_5);
16261 __Pyx_GOTREF(__pyx_t_1);
16270 __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
16271 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_error)
16272 __Pyx_GOTREF(__pyx_t_6);
16273 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
16274 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16275 __PYX_ERR(1, 497, __pyx_L5_except_error)
16277 goto __pyx_L5_except_error;
16278 __pyx_L5_except_error:;
16287 __Pyx_XGIVEREF(__pyx_t_2);
16288 __Pyx_XGIVEREF(__pyx_t_3);
16289 __Pyx_XGIVEREF(__pyx_t_4);
16290 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
16291 goto __pyx_L1_error;
16292 __pyx_L6_except_return:;
16293 __Pyx_XGIVEREF(__pyx_t_2);
16294 __Pyx_XGIVEREF(__pyx_t_3);
16295 __Pyx_XGIVEREF(__pyx_t_4);
16296 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
16310 __Pyx_XDECREF(__pyx_t_1);
16311 __Pyx_XDECREF(__pyx_t_5);
16312 __Pyx_XDECREF(__pyx_t_6);
16313 __Pyx_XDECREF(__pyx_t_7);
16314 __Pyx_XDECREF(__pyx_t_9);
16315 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16318 __Pyx_XDECREF(__pyx_v_struct);
16319 __Pyx_XDECREF(__pyx_v_bytesitem);
16320 __Pyx_XDECREF(__pyx_v_result);
16321 __Pyx_XGIVEREF(__pyx_r);
16322 __Pyx_TraceReturn(__pyx_r, 0);
16323 __Pyx_RefNannyFinishContext();
16335 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16336 PyObject *__pyx_v_struct = NULL;
16338 PyObject *__pyx_v_bytesvalue = 0;
16339 Py_ssize_t __pyx_v_i;
16340 PyObject *__pyx_r = NULL;
16341 __Pyx_TraceDeclarations
16342 __Pyx_RefNannyDeclarations
16343 PyObject *__pyx_t_1 = NULL;
16346 PyObject *__pyx_t_4 = NULL;
16347 PyObject *__pyx_t_5 = NULL;
16348 PyObject *__pyx_t_6 = NULL;
16350 PyObject *__pyx_t_8 = NULL;
16351 Py_ssize_t __pyx_t_9;
16352 PyObject *__pyx_t_10 = NULL;
16357 int __pyx_lineno = 0;
16358 const char *__pyx_filename = NULL;
16359 int __pyx_clineno = 0;
16360 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
16361 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 503, 0, __PYX_ERR(1, 503, __pyx_L1_error));
16370 __Pyx_TraceLine(506,0,__PYX_ERR(1, 506, __pyx_L1_error))
16371 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
16372 __Pyx_GOTREF(__pyx_t_1);
16373 __pyx_v_struct = __pyx_t_1;
16383 __Pyx_TraceLine(511,0,__PYX_ERR(1, 511, __pyx_L1_error))
16384 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
16385 __pyx_t_3 = (__pyx_t_2 != 0);
16395 __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
16396 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
16397 __Pyx_GOTREF(__pyx_t_1);
16398 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16399 __Pyx_GOTREF(__pyx_t_4);
16400 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
16401 __Pyx_GOTREF(__pyx_t_5);
16402 __Pyx_GIVEREF(__pyx_t_4);
16403 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
16405 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16406 __Pyx_GOTREF(__pyx_t_4);
16407 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
16408 __Pyx_GOTREF(__pyx_t_6);
16409 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16410 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16411 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16412 __Pyx_GOTREF(__pyx_t_4);
16413 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16414 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16415 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
16416 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
16436 __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
16438 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
16439 __Pyx_GOTREF(__pyx_t_6);
16440 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
16441 __Pyx_GOTREF(__pyx_t_1);
16444 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
16445 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16446 if (likely(__pyx_t_5)) {
16447 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
16448 __Pyx_INCREF(__pyx_t_5);
16449 __Pyx_INCREF(
function);
16450 __Pyx_DECREF_SET(__pyx_t_6,
function);
16454 #if CYTHON_FAST_PYCALL
16455 if (PyFunction_Check(__pyx_t_6)) {
16456 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
16457 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
16458 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16459 __Pyx_GOTREF(__pyx_t_4);
16460 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16463 #if CYTHON_FAST_PYCCALL
16464 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
16465 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
16466 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
16467 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16468 __Pyx_GOTREF(__pyx_t_4);
16469 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16473 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
16474 __Pyx_GOTREF(__pyx_t_8);
16476 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
16478 __Pyx_GIVEREF(__pyx_t_1);
16479 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
16480 __Pyx_INCREF(__pyx_v_value);
16481 __Pyx_GIVEREF(__pyx_v_value);
16482 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
16484 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
16485 __Pyx_GOTREF(__pyx_t_4);
16486 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16488 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16489 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
16490 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
16502 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
16504 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
16505 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
16506 __PYX_ERR(1, 516, __pyx_L1_error)
16508 __Pyx_INCREF(__pyx_v_bytesvalue);
16509 __pyx_t_10 = __pyx_v_bytesvalue;
16510 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
16511 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
16512 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
16513 __pyx_t_11 = __pyx_t_14;
16514 __pyx_v_c = (__pyx_t_11[0]);
16523 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
16524 __pyx_v_i = __pyx_t_9;
16533 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
16534 __pyx_t_9 = (__pyx_t_9 + 1);
16543 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
16544 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
16546 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16557 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16560 __Pyx_XDECREF(__pyx_t_1);
16561 __Pyx_XDECREF(__pyx_t_4);
16562 __Pyx_XDECREF(__pyx_t_5);
16563 __Pyx_XDECREF(__pyx_t_6);
16564 __Pyx_XDECREF(__pyx_t_8);
16565 __Pyx_XDECREF(__pyx_t_10);
16566 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16569 __Pyx_XDECREF(__pyx_v_struct);
16570 __Pyx_XDECREF(__pyx_v_bytesvalue);
16571 __Pyx_XGIVEREF(__pyx_r);
16572 __Pyx_TraceReturn(__pyx_r, 0);
16573 __Pyx_RefNannyFinishContext();
16586 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
16587 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
16589 __Pyx_RefNannyDeclarations
16590 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
16591 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
16594 __Pyx_RefNannyFinishContext();
16598 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
16600 __Pyx_TraceDeclarations
16601 __Pyx_RefNannyDeclarations
16604 PyObject *__pyx_t_3 = NULL;
16605 Py_ssize_t *__pyx_t_4;
16609 Py_ssize_t __pyx_t_8;
16610 int __pyx_lineno = 0;
16611 const char *__pyx_filename = NULL;
16612 int __pyx_clineno = 0;
16613 if (__pyx_v_info == NULL) {
16614 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
16617 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
16618 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
16619 __Pyx_GIVEREF(__pyx_v_info->obj);
16620 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 520, 0, __PYX_ERR(1, 520, __pyx_L1_error));
16629 __Pyx_TraceLine(521,0,__PYX_ERR(1, 521, __pyx_L1_error))
16630 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
16633 __pyx_t_1 = __pyx_t_2;
16634 goto __pyx_L4_bool_binop_done;
16636 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
16637 __pyx_t_1 = __pyx_t_2;
16638 __pyx_L4_bool_binop_done:;
16639 if (unlikely(__pyx_t_1)) {
16648 __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
16649 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
16650 __Pyx_GOTREF(__pyx_t_3);
16651 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16652 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16653 __PYX_ERR(1, 522, __pyx_L1_error)
16671 __Pyx_TraceLine(524,0,__PYX_ERR(1, 524, __pyx_L1_error))
16672 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
16682 __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
16683 __pyx_t_4 = __pyx_v_self->view.shape;
16684 __pyx_v_info->shape = __pyx_t_4;
16703 __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
16705 __pyx_v_info->shape = NULL;
16716 __Pyx_TraceLine(529,0,__PYX_ERR(1, 529, __pyx_L1_error))
16717 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
16727 __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
16728 __pyx_t_4 = __pyx_v_self->view.strides;
16729 __pyx_v_info->strides = __pyx_t_4;
16748 __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
16750 __pyx_v_info->strides = NULL;
16761 __Pyx_TraceLine(534,0,__PYX_ERR(1, 534, __pyx_L1_error))
16762 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
16772 __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
16773 __pyx_t_4 = __pyx_v_self->view.suboffsets;
16774 __pyx_v_info->suboffsets = __pyx_t_4;
16793 __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
16795 __pyx_v_info->suboffsets = NULL;
16806 __Pyx_TraceLine(539,0,__PYX_ERR(1, 539, __pyx_L1_error))
16807 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
16817 __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
16818 __pyx_t_5 = __pyx_v_self->view.format;
16819 __pyx_v_info->format = __pyx_t_5;
16838 __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
16840 __pyx_v_info->format = NULL;
16851 __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
16852 __pyx_t_6 = __pyx_v_self->view.buf;
16853 __pyx_v_info->buf = __pyx_t_6;
16862 __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
16863 __pyx_t_7 = __pyx_v_self->view.ndim;
16864 __pyx_v_info->ndim = __pyx_t_7;
16873 __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
16874 __pyx_t_8 = __pyx_v_self->view.itemsize;
16875 __pyx_v_info->itemsize = __pyx_t_8;
16884 __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
16885 __pyx_t_8 = __pyx_v_self->view.len;
16886 __pyx_v_info->len = __pyx_t_8;
16895 __Pyx_TraceLine(548,0,__PYX_ERR(1, 548, __pyx_L1_error))
16896 __pyx_t_1 = __pyx_v_self->view.readonly;
16897 __pyx_v_info->readonly = __pyx_t_1;
16906 __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
16907 __Pyx_INCREF(((PyObject *)__pyx_v_self));
16908 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16909 __Pyx_GOTREF(__pyx_v_info->obj);
16910 __Pyx_DECREF(__pyx_v_info->obj);
16911 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
16925 __Pyx_XDECREF(__pyx_t_3);
16926 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16928 if (__pyx_v_info->obj != NULL) {
16929 __Pyx_GOTREF(__pyx_v_info->obj);
16930 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
16934 if (__pyx_v_info->obj == Py_None) {
16935 __Pyx_GOTREF(__pyx_v_info->obj);
16936 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
16939 __Pyx_TraceReturn(Py_None, 0);
16940 __Pyx_RefNannyFinishContext();
16953 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
16954 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
16955 PyObject *__pyx_r = 0;
16956 __Pyx_RefNannyDeclarations
16957 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
16958 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
16961 __Pyx_RefNannyFinishContext();
16965 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
16966 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16967 PyObject *__pyx_r = NULL;
16968 __Pyx_TraceDeclarations
16969 __Pyx_RefNannyDeclarations
16970 PyObject *__pyx_t_1 = NULL;
16972 int __pyx_lineno = 0;
16973 const char *__pyx_filename = NULL;
16974 int __pyx_clineno = 0;
16975 __Pyx_RefNannySetupContext(
"__get__", 0);
16976 __Pyx_TraceCall(
"__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
16985 __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
16986 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
16987 __Pyx_GOTREF(__pyx_t_1);
16988 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
16989 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
16999 __Pyx_TraceLine(557,0,__PYX_ERR(1, 557, __pyx_L1_error))
17000 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
17009 __Pyx_TraceLine(558,0,__PYX_ERR(1, 558, __pyx_L1_error))
17010 __Pyx_XDECREF(__pyx_r);
17011 __Pyx_INCREF(((PyObject *)__pyx_v_result));
17012 __pyx_r = ((PyObject *)__pyx_v_result);
17025 __Pyx_XDECREF(__pyx_t_1);
17026 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17029 __Pyx_XDECREF((PyObject *)__pyx_v_result);
17030 __Pyx_XGIVEREF(__pyx_r);
17031 __Pyx_TraceReturn(__pyx_r, 0);
17032 __Pyx_RefNannyFinishContext();
17045 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
17046 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
17047 PyObject *__pyx_r = 0;
17048 __Pyx_RefNannyDeclarations
17049 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17050 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17053 __Pyx_RefNannyFinishContext();
17057 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17058 PyObject *__pyx_r = NULL;
17059 __Pyx_TraceDeclarations
17060 __Pyx_RefNannyDeclarations
17061 int __pyx_lineno = 0;
17062 const char *__pyx_filename = NULL;
17063 int __pyx_clineno = 0;
17064 __Pyx_RefNannySetupContext(
"__get__", 0);
17065 __Pyx_TraceCall(
"__get__", __pyx_f[1], 561, 0, __PYX_ERR(1, 561, __pyx_L1_error));
17074 __Pyx_TraceLine(562,0,__PYX_ERR(1, 562, __pyx_L1_error))
17075 __Pyx_XDECREF(__pyx_r);
17076 __Pyx_INCREF(__pyx_v_self->obj);
17077 __pyx_r = __pyx_v_self->obj;
17090 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17093 __Pyx_XGIVEREF(__pyx_r);
17094 __Pyx_TraceReturn(__pyx_r, 0);
17095 __Pyx_RefNannyFinishContext();
17108 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
17109 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
17110 PyObject *__pyx_r = 0;
17111 __Pyx_RefNannyDeclarations
17112 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17113 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17116 __Pyx_RefNannyFinishContext();
17120 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17121 Py_ssize_t __pyx_v_length;
17122 PyObject *__pyx_r = NULL;
17123 __Pyx_TraceDeclarations
17124 __Pyx_RefNannyDeclarations
17125 PyObject *__pyx_t_1 = NULL;
17126 Py_ssize_t *__pyx_t_2;
17127 Py_ssize_t *__pyx_t_3;
17128 Py_ssize_t *__pyx_t_4;
17129 PyObject *__pyx_t_5 = NULL;
17130 int __pyx_lineno = 0;
17131 const char *__pyx_filename = NULL;
17132 int __pyx_clineno = 0;
17133 __Pyx_RefNannySetupContext(
"__get__", 0);
17134 __Pyx_TraceCall(
"__get__", __pyx_f[1], 565, 0, __PYX_ERR(1, 565, __pyx_L1_error));
17143 __Pyx_TraceLine(566,0,__PYX_ERR(1, 566, __pyx_L1_error))
17144 __Pyx_XDECREF(__pyx_r);
17145 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
17146 __Pyx_GOTREF(__pyx_t_1);
17147 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
17148 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17149 __pyx_t_2 = __pyx_t_4;
17150 __pyx_v_length = (__pyx_t_2[0]);
17151 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
17152 __Pyx_GOTREF(__pyx_t_5);
17153 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
17154 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17156 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
17157 __Pyx_GOTREF(__pyx_t_5);
17158 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17159 __pyx_r = __pyx_t_5;
17173 __Pyx_XDECREF(__pyx_t_1);
17174 __Pyx_XDECREF(__pyx_t_5);
17175 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17178 __Pyx_XGIVEREF(__pyx_r);
17179 __Pyx_TraceReturn(__pyx_r, 0);
17180 __Pyx_RefNannyFinishContext();
17193 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
17194 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
17195 PyObject *__pyx_r = 0;
17196 __Pyx_RefNannyDeclarations
17197 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17198 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17201 __Pyx_RefNannyFinishContext();
17205 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17206 Py_ssize_t __pyx_v_stride;
17207 PyObject *__pyx_r = NULL;
17208 __Pyx_TraceDeclarations
17209 __Pyx_RefNannyDeclarations
17211 PyObject *__pyx_t_2 = NULL;
17212 Py_ssize_t *__pyx_t_3;
17213 Py_ssize_t *__pyx_t_4;
17214 Py_ssize_t *__pyx_t_5;
17215 PyObject *__pyx_t_6 = NULL;
17216 int __pyx_lineno = 0;
17217 const char *__pyx_filename = NULL;
17218 int __pyx_clineno = 0;
17219 __Pyx_RefNannySetupContext(
"__get__", 0);
17220 __Pyx_TraceCall(
"__get__", __pyx_f[1], 569, 0, __PYX_ERR(1, 569, __pyx_L1_error));
17229 __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
17230 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
17231 if (unlikely(__pyx_t_1)) {
17240 __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
17241 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
17242 __Pyx_GOTREF(__pyx_t_2);
17243 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
17244 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17245 __PYX_ERR(1, 572, __pyx_L1_error)
17263 __Pyx_TraceLine(574,0,__PYX_ERR(1, 574, __pyx_L1_error))
17264 __Pyx_XDECREF(__pyx_r);
17265 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
17266 __Pyx_GOTREF(__pyx_t_2);
17267 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
17268 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
17269 __pyx_t_3 = __pyx_t_5;
17270 __pyx_v_stride = (__pyx_t_3[0]);
17271 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
17272 __Pyx_GOTREF(__pyx_t_6);
17273 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
17274 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17276 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
17277 __Pyx_GOTREF(__pyx_t_6);
17278 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17279 __pyx_r = __pyx_t_6;
17293 __Pyx_XDECREF(__pyx_t_2);
17294 __Pyx_XDECREF(__pyx_t_6);
17295 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17298 __Pyx_XGIVEREF(__pyx_r);
17299 __Pyx_TraceReturn(__pyx_r, 0);
17300 __Pyx_RefNannyFinishContext();
17313 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
17314 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
17315 PyObject *__pyx_r = 0;
17316 __Pyx_RefNannyDeclarations
17317 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17318 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17321 __Pyx_RefNannyFinishContext();
17325 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17326 Py_ssize_t __pyx_v_suboffset;
17327 PyObject *__pyx_r = NULL;
17328 __Pyx_TraceDeclarations
17329 __Pyx_RefNannyDeclarations
17331 PyObject *__pyx_t_2 = NULL;
17332 PyObject *__pyx_t_3 = NULL;
17333 Py_ssize_t *__pyx_t_4;
17334 Py_ssize_t *__pyx_t_5;
17335 Py_ssize_t *__pyx_t_6;
17336 int __pyx_lineno = 0;
17337 const char *__pyx_filename = NULL;
17338 int __pyx_clineno = 0;
17339 __Pyx_RefNannySetupContext(
"__get__", 0);
17340 __Pyx_TraceCall(
"__get__", __pyx_f[1], 577, 0, __PYX_ERR(1, 577, __pyx_L1_error));
17349 __Pyx_TraceLine(578,0,__PYX_ERR(1, 578, __pyx_L1_error))
17350 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
17360 __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
17361 __Pyx_XDECREF(__pyx_r);
17362 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
17363 __Pyx_GOTREF(__pyx_t_2);
17364 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__33, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
17365 __Pyx_GOTREF(__pyx_t_3);
17366 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17367 __pyx_r = __pyx_t_3;
17387 __Pyx_TraceLine(581,0,__PYX_ERR(1, 581, __pyx_L1_error))
17388 __Pyx_XDECREF(__pyx_r);
17389 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
17390 __Pyx_GOTREF(__pyx_t_3);
17391 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
17392 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
17393 __pyx_t_4 = __pyx_t_6;
17394 __pyx_v_suboffset = (__pyx_t_4[0]);
17395 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
17396 __Pyx_GOTREF(__pyx_t_2);
17397 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
17398 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17400 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
17401 __Pyx_GOTREF(__pyx_t_2);
17402 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17403 __pyx_r = __pyx_t_2;
17417 __Pyx_XDECREF(__pyx_t_2);
17418 __Pyx_XDECREF(__pyx_t_3);
17419 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17422 __Pyx_XGIVEREF(__pyx_r);
17423 __Pyx_TraceReturn(__pyx_r, 0);
17424 __Pyx_RefNannyFinishContext();
17437 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
17438 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
17439 PyObject *__pyx_r = 0;
17440 __Pyx_RefNannyDeclarations
17441 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17442 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17445 __Pyx_RefNannyFinishContext();
17449 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17450 PyObject *__pyx_r = NULL;
17451 __Pyx_TraceDeclarations
17452 __Pyx_RefNannyDeclarations
17453 PyObject *__pyx_t_1 = NULL;
17454 int __pyx_lineno = 0;
17455 const char *__pyx_filename = NULL;
17456 int __pyx_clineno = 0;
17457 __Pyx_RefNannySetupContext(
"__get__", 0);
17458 __Pyx_TraceCall(
"__get__", __pyx_f[1], 584, 0, __PYX_ERR(1, 584, __pyx_L1_error));
17467 __Pyx_TraceLine(585,0,__PYX_ERR(1, 585, __pyx_L1_error))
17468 __Pyx_XDECREF(__pyx_r);
17469 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
17470 __Pyx_GOTREF(__pyx_t_1);
17471 __pyx_r = __pyx_t_1;
17485 __Pyx_XDECREF(__pyx_t_1);
17486 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17489 __Pyx_XGIVEREF(__pyx_r);
17490 __Pyx_TraceReturn(__pyx_r, 0);
17491 __Pyx_RefNannyFinishContext();
17504 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
17505 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
17506 PyObject *__pyx_r = 0;
17507 __Pyx_RefNannyDeclarations
17508 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17509 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17512 __Pyx_RefNannyFinishContext();
17516 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17517 PyObject *__pyx_r = NULL;
17518 __Pyx_TraceDeclarations
17519 __Pyx_RefNannyDeclarations
17520 PyObject *__pyx_t_1 = NULL;
17521 int __pyx_lineno = 0;
17522 const char *__pyx_filename = NULL;
17523 int __pyx_clineno = 0;
17524 __Pyx_RefNannySetupContext(
"__get__", 0);
17525 __Pyx_TraceCall(
"__get__", __pyx_f[1], 588, 0, __PYX_ERR(1, 588, __pyx_L1_error));
17534 __Pyx_TraceLine(589,0,__PYX_ERR(1, 589, __pyx_L1_error))
17535 __Pyx_XDECREF(__pyx_r);
17536 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
17537 __Pyx_GOTREF(__pyx_t_1);
17538 __pyx_r = __pyx_t_1;
17552 __Pyx_XDECREF(__pyx_t_1);
17553 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17556 __Pyx_XGIVEREF(__pyx_r);
17557 __Pyx_TraceReturn(__pyx_r, 0);
17558 __Pyx_RefNannyFinishContext();
17571 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
17572 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
17573 PyObject *__pyx_r = 0;
17574 __Pyx_RefNannyDeclarations
17575 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17576 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17579 __Pyx_RefNannyFinishContext();
17583 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17584 PyObject *__pyx_r = NULL;
17585 __Pyx_TraceDeclarations
17586 __Pyx_RefNannyDeclarations
17587 PyObject *__pyx_t_1 = NULL;
17588 PyObject *__pyx_t_2 = NULL;
17589 PyObject *__pyx_t_3 = NULL;
17590 int __pyx_lineno = 0;
17591 const char *__pyx_filename = NULL;
17592 int __pyx_clineno = 0;
17593 __Pyx_RefNannySetupContext(
"__get__", 0);
17594 __Pyx_TraceCall(
"__get__", __pyx_f[1], 592, 0, __PYX_ERR(1, 592, __pyx_L1_error));
17603 __Pyx_TraceLine(593,0,__PYX_ERR(1, 593, __pyx_L1_error))
17604 __Pyx_XDECREF(__pyx_r);
17605 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
17606 __Pyx_GOTREF(__pyx_t_1);
17607 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
17608 __Pyx_GOTREF(__pyx_t_2);
17609 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
17610 __Pyx_GOTREF(__pyx_t_3);
17611 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17612 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17613 __pyx_r = __pyx_t_3;
17627 __Pyx_XDECREF(__pyx_t_1);
17628 __Pyx_XDECREF(__pyx_t_2);
17629 __Pyx_XDECREF(__pyx_t_3);
17630 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17633 __Pyx_XGIVEREF(__pyx_r);
17634 __Pyx_TraceReturn(__pyx_r, 0);
17635 __Pyx_RefNannyFinishContext();
17648 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
17649 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
17650 PyObject *__pyx_r = 0;
17651 __Pyx_RefNannyDeclarations
17652 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17653 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17656 __Pyx_RefNannyFinishContext();
17660 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17661 PyObject *__pyx_v_result = NULL;
17662 PyObject *__pyx_v_length = NULL;
17663 PyObject *__pyx_r = NULL;
17664 __Pyx_TraceDeclarations
17665 __Pyx_RefNannyDeclarations
17668 Py_ssize_t *__pyx_t_3;
17669 Py_ssize_t *__pyx_t_4;
17670 Py_ssize_t *__pyx_t_5;
17671 PyObject *__pyx_t_6 = NULL;
17672 int __pyx_lineno = 0;
17673 const char *__pyx_filename = NULL;
17674 int __pyx_clineno = 0;
17675 __Pyx_RefNannySetupContext(
"__get__", 0);
17676 __Pyx_TraceCall(
"__get__", __pyx_f[1], 596, 0, __PYX_ERR(1, 596, __pyx_L1_error));
17685 __Pyx_TraceLine(597,0,__PYX_ERR(1, 597, __pyx_L1_error))
17686 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
17687 __pyx_t_2 = (__pyx_t_1 != 0);
17697 __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
17698 __Pyx_INCREF(__pyx_int_1);
17699 __pyx_v_result = __pyx_int_1;
17708 __Pyx_TraceLine(600,0,__PYX_ERR(1, 600, __pyx_L1_error))
17709 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
17710 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
17711 __pyx_t_3 = __pyx_t_5;
17712 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
17713 __Pyx_GOTREF(__pyx_t_6);
17714 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
17724 __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
17725 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
17726 __Pyx_GOTREF(__pyx_t_6);
17727 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
17738 __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
17739 __Pyx_INCREF(__pyx_v_result);
17740 __Pyx_GIVEREF(__pyx_v_result);
17741 __Pyx_GOTREF(__pyx_v_self->_size);
17742 __Pyx_DECREF(__pyx_v_self->_size);
17743 __pyx_v_self->_size = __pyx_v_result;
17761 __Pyx_TraceLine(605,0,__PYX_ERR(1, 605, __pyx_L1_error))
17762 __Pyx_XDECREF(__pyx_r);
17763 __Pyx_INCREF(__pyx_v_self->_size);
17764 __pyx_r = __pyx_v_self->_size;
17777 __Pyx_XDECREF(__pyx_t_6);
17778 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17781 __Pyx_XDECREF(__pyx_v_result);
17782 __Pyx_XDECREF(__pyx_v_length);
17783 __Pyx_XGIVEREF(__pyx_r);
17784 __Pyx_TraceReturn(__pyx_r, 0);
17785 __Pyx_RefNannyFinishContext();
17798 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
17799 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
17800 Py_ssize_t __pyx_r;
17801 __Pyx_RefNannyDeclarations
17802 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
17803 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17806 __Pyx_RefNannyFinishContext();
17810 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17811 Py_ssize_t __pyx_r;
17812 __Pyx_TraceDeclarations
17813 __Pyx_RefNannyDeclarations
17815 int __pyx_lineno = 0;
17816 const char *__pyx_filename = NULL;
17817 int __pyx_clineno = 0;
17818 __Pyx_RefNannySetupContext(
"__len__", 0);
17819 __Pyx_TraceCall(
"__len__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
17828 __Pyx_TraceLine(608,0,__PYX_ERR(1, 608, __pyx_L1_error))
17829 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
17839 __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
17840 __pyx_r = (__pyx_v_self->view.shape[0]);
17859 __Pyx_TraceLine(611,0,__PYX_ERR(1, 611, __pyx_L1_error))
17873 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17876 __Pyx_TraceReturn(Py_None, 0);
17877 __Pyx_RefNannyFinishContext();
17890 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
17891 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
17892 PyObject *__pyx_r = 0;
17893 __Pyx_RefNannyDeclarations
17894 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
17895 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
17898 __Pyx_RefNannyFinishContext();
17902 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
17903 PyObject *__pyx_r = NULL;
17904 __Pyx_TraceDeclarations
17905 __Pyx_RefNannyDeclarations
17906 PyObject *__pyx_t_1 = NULL;
17907 PyObject *__pyx_t_2 = NULL;
17908 PyObject *__pyx_t_3 = NULL;
17909 int __pyx_lineno = 0;
17910 const char *__pyx_filename = NULL;
17911 int __pyx_clineno = 0;
17912 __Pyx_RefNannySetupContext(
"__repr__", 0);
17913 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 613, 0, __PYX_ERR(1, 613, __pyx_L1_error));
17922 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
17923 __Pyx_XDECREF(__pyx_r);
17924 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
17925 __Pyx_GOTREF(__pyx_t_1);
17926 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
17927 __Pyx_GOTREF(__pyx_t_2);
17928 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17929 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
17930 __Pyx_GOTREF(__pyx_t_1);
17931 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17940 __Pyx_TraceLine(615,0,__PYX_ERR(1, 615, __pyx_L1_error))
17941 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
17942 __Pyx_GOTREF(__pyx_t_2);
17951 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
17952 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
17953 __Pyx_GOTREF(__pyx_t_3);
17954 __Pyx_GIVEREF(__pyx_t_1);
17955 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
17956 __Pyx_GIVEREF(__pyx_t_2);
17957 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
17960 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
17961 __Pyx_GOTREF(__pyx_t_2);
17962 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17963 __pyx_r = __pyx_t_2;
17977 __Pyx_XDECREF(__pyx_t_1);
17978 __Pyx_XDECREF(__pyx_t_2);
17979 __Pyx_XDECREF(__pyx_t_3);
17980 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17983 __Pyx_XGIVEREF(__pyx_r);
17984 __Pyx_TraceReturn(__pyx_r, 0);
17985 __Pyx_RefNannyFinishContext();
17998 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
17999 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
18000 PyObject *__pyx_r = 0;
18001 __Pyx_RefNannyDeclarations
18002 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
18003 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
18006 __Pyx_RefNannyFinishContext();
18010 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
18011 PyObject *__pyx_r = NULL;
18012 __Pyx_TraceDeclarations
18013 __Pyx_RefNannyDeclarations
18014 PyObject *__pyx_t_1 = NULL;
18015 PyObject *__pyx_t_2 = NULL;
18016 int __pyx_lineno = 0;
18017 const char *__pyx_filename = NULL;
18018 int __pyx_clineno = 0;
18019 __Pyx_RefNannySetupContext(
"__str__", 0);
18020 __Pyx_TraceCall(
"__str__", __pyx_f[1], 617, 0, __PYX_ERR(1, 617, __pyx_L1_error));
18029 __Pyx_TraceLine(618,0,__PYX_ERR(1, 618, __pyx_L1_error))
18030 __Pyx_XDECREF(__pyx_r);
18031 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
18032 __Pyx_GOTREF(__pyx_t_1);
18033 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
18034 __Pyx_GOTREF(__pyx_t_2);
18035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18036 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
18037 __Pyx_GOTREF(__pyx_t_1);
18038 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18039 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
18040 __Pyx_GOTREF(__pyx_t_2);
18041 __Pyx_GIVEREF(__pyx_t_1);
18042 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
18044 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
18045 __Pyx_GOTREF(__pyx_t_1);
18046 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18047 __pyx_r = __pyx_t_1;
18061 __Pyx_XDECREF(__pyx_t_1);
18062 __Pyx_XDECREF(__pyx_t_2);
18063 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18066 __Pyx_XGIVEREF(__pyx_r);
18067 __Pyx_TraceReturn(__pyx_r, 0);
18068 __Pyx_RefNannyFinishContext();
18081 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18082 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
18083 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18084 PyObject *__pyx_r = 0;
18085 __Pyx_RefNannyDeclarations
18086 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
18087 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
18090 __Pyx_RefNannyFinishContext();
18094 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
18095 __Pyx_memviewslice *__pyx_v_mslice;
18096 __Pyx_memviewslice __pyx_v_tmp;
18097 PyObject *__pyx_r = NULL;
18098 __Pyx_TraceDeclarations
18099 __Pyx_RefNannyDeclarations
18100 __Pyx_memviewslice *__pyx_t_1;
18101 PyObject *__pyx_t_2 = NULL;
18102 int __pyx_lineno = 0;
18103 const char *__pyx_filename = NULL;
18104 int __pyx_clineno = 0;
18105 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
18106 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
18115 __Pyx_TraceLine(624,0,__PYX_ERR(1, 624, __pyx_L1_error))
18116 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
18117 __pyx_v_mslice = __pyx_t_1;
18126 __Pyx_TraceLine(625,0,__PYX_ERR(1, 625, __pyx_L1_error))
18127 __Pyx_XDECREF(__pyx_r);
18128 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
18129 __Pyx_GOTREF(__pyx_t_2);
18130 __pyx_r = __pyx_t_2;
18144 __Pyx_XDECREF(__pyx_t_2);
18145 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
18148 __Pyx_XGIVEREF(__pyx_r);
18149 __Pyx_TraceReturn(__pyx_r, 0);
18150 __Pyx_RefNannyFinishContext();
18163 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18164 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
18165 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18166 PyObject *__pyx_r = 0;
18167 __Pyx_RefNannyDeclarations
18168 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
18169 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
18172 __Pyx_RefNannyFinishContext();
18176 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
18177 __Pyx_memviewslice *__pyx_v_mslice;
18178 __Pyx_memviewslice __pyx_v_tmp;
18179 PyObject *__pyx_r = NULL;
18180 __Pyx_TraceDeclarations
18181 __Pyx_RefNannyDeclarations
18182 __Pyx_memviewslice *__pyx_t_1;
18183 PyObject *__pyx_t_2 = NULL;
18184 int __pyx_lineno = 0;
18185 const char *__pyx_filename = NULL;
18186 int __pyx_clineno = 0;
18187 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
18188 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
18197 __Pyx_TraceLine(630,0,__PYX_ERR(1, 630, __pyx_L1_error))
18198 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
18199 __pyx_v_mslice = __pyx_t_1;
18208 __Pyx_TraceLine(631,0,__PYX_ERR(1, 631, __pyx_L1_error))
18209 __Pyx_XDECREF(__pyx_r);
18210 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
18211 __Pyx_GOTREF(__pyx_t_2);
18212 __pyx_r = __pyx_t_2;
18226 __Pyx_XDECREF(__pyx_t_2);
18227 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
18230 __Pyx_XGIVEREF(__pyx_r);
18231 __Pyx_TraceReturn(__pyx_r, 0);
18232 __Pyx_RefNannyFinishContext();
18245 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18246 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
18247 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18248 PyObject *__pyx_r = 0;
18249 __Pyx_RefNannyDeclarations
18250 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
18251 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
18254 __Pyx_RefNannyFinishContext();
18258 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
18259 __Pyx_memviewslice __pyx_v_mslice;
18261 PyObject *__pyx_r = NULL;
18262 __Pyx_TraceDeclarations
18263 __Pyx_RefNannyDeclarations
18264 __Pyx_memviewslice __pyx_t_1;
18265 PyObject *__pyx_t_2 = NULL;
18266 int __pyx_lineno = 0;
18267 const char *__pyx_filename = NULL;
18268 int __pyx_clineno = 0;
18269 __Pyx_RefNannySetupContext(
"copy", 0);
18270 __Pyx_TraceCall(
"copy", __pyx_f[1], 633, 0, __PYX_ERR(1, 633, __pyx_L1_error));
18279 __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
18280 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
18289 __Pyx_TraceLine(637,0,__PYX_ERR(1, 637, __pyx_L1_error))
18290 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
18299 __Pyx_TraceLine(638,0,__PYX_ERR(1, 638, __pyx_L1_error))
18300 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
18301 __pyx_v_mslice = __pyx_t_1;
18310 __Pyx_TraceLine(643,0,__PYX_ERR(1, 643, __pyx_L1_error))
18311 __Pyx_XDECREF(__pyx_r);
18312 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
18313 __Pyx_GOTREF(__pyx_t_2);
18314 __pyx_r = __pyx_t_2;
18328 __Pyx_XDECREF(__pyx_t_2);
18329 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18332 __Pyx_XGIVEREF(__pyx_r);
18333 __Pyx_TraceReturn(__pyx_r, 0);
18334 __Pyx_RefNannyFinishContext();
18347 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18348 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
18349 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18350 PyObject *__pyx_r = 0;
18351 __Pyx_RefNannyDeclarations
18352 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
18353 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
18356 __Pyx_RefNannyFinishContext();
18360 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
18361 __Pyx_memviewslice __pyx_v_src;
18362 __Pyx_memviewslice __pyx_v_dst;
18364 PyObject *__pyx_r = NULL;
18365 __Pyx_TraceDeclarations
18366 __Pyx_RefNannyDeclarations
18367 __Pyx_memviewslice __pyx_t_1;
18368 PyObject *__pyx_t_2 = NULL;
18369 int __pyx_lineno = 0;
18370 const char *__pyx_filename = NULL;
18371 int __pyx_clineno = 0;
18372 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
18373 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 645, 0, __PYX_ERR(1, 645, __pyx_L1_error));
18382 __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
18383 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
18392 __Pyx_TraceLine(649,0,__PYX_ERR(1, 649, __pyx_L1_error))
18393 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
18402 __Pyx_TraceLine(650,0,__PYX_ERR(1, 650, __pyx_L1_error))
18403 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
18404 __pyx_v_dst = __pyx_t_1;
18413 __Pyx_TraceLine(655,0,__PYX_ERR(1, 655, __pyx_L1_error))
18414 __Pyx_XDECREF(__pyx_r);
18415 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
18416 __Pyx_GOTREF(__pyx_t_2);
18417 __pyx_r = __pyx_t_2;
18431 __Pyx_XDECREF(__pyx_t_2);
18432 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
18435 __Pyx_XGIVEREF(__pyx_r);
18436 __Pyx_TraceReturn(__pyx_r, 0);
18437 __Pyx_RefNannyFinishContext();
18448 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18449 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
18450 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18451 PyObject *__pyx_r = 0;
18452 __Pyx_RefNannyDeclarations
18453 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
18454 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
18457 __Pyx_RefNannyFinishContext();
18461 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
18462 PyObject *__pyx_r = NULL;
18463 __Pyx_TraceDeclarations
18464 __Pyx_RefNannyDeclarations
18465 PyObject *__pyx_t_1 = NULL;
18466 int __pyx_lineno = 0;
18467 const char *__pyx_filename = NULL;
18468 int __pyx_clineno = 0;
18469 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
18470 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
18478 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
18479 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18480 __Pyx_GOTREF(__pyx_t_1);
18481 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18482 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18483 __PYX_ERR(1, 2, __pyx_L1_error)
18493 __Pyx_XDECREF(__pyx_t_1);
18494 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18496 __Pyx_XGIVEREF(__pyx_r);
18497 __Pyx_TraceReturn(__pyx_r, 0);
18498 __Pyx_RefNannyFinishContext();
18510 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
18511 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
18512 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18513 PyObject *__pyx_r = 0;
18514 __Pyx_RefNannyDeclarations
18515 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
18516 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18519 __Pyx_RefNannyFinishContext();
18523 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18524 PyObject *__pyx_r = NULL;
18525 __Pyx_TraceDeclarations
18526 __Pyx_RefNannyDeclarations
18527 PyObject *__pyx_t_1 = NULL;
18528 int __pyx_lineno = 0;
18529 const char *__pyx_filename = NULL;
18530 int __pyx_clineno = 0;
18531 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
18532 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
18539 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
18540 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18541 __Pyx_GOTREF(__pyx_t_1);
18542 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18543 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18544 __PYX_ERR(1, 4, __pyx_L1_error)
18555 __Pyx_XDECREF(__pyx_t_1);
18556 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18558 __Pyx_XGIVEREF(__pyx_r);
18559 __Pyx_TraceReturn(__pyx_r, 0);
18560 __Pyx_RefNannyFinishContext();
18572 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
18573 struct __pyx_memoryview_obj *__pyx_v_result = 0;
18574 PyObject *__pyx_r = NULL;
18575 __Pyx_TraceDeclarations
18576 __Pyx_RefNannyDeclarations
18577 PyObject *__pyx_t_1 = NULL;
18578 PyObject *__pyx_t_2 = NULL;
18579 PyObject *__pyx_t_3 = NULL;
18580 int __pyx_lineno = 0;
18581 const char *__pyx_filename = NULL;
18582 int __pyx_clineno = 0;
18583 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
18584 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
18593 __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
18594 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
18595 __Pyx_GOTREF(__pyx_t_1);
18596 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
18597 __Pyx_GOTREF(__pyx_t_2);
18598 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
18599 __Pyx_GOTREF(__pyx_t_3);
18600 __Pyx_INCREF(__pyx_v_o);
18601 __Pyx_GIVEREF(__pyx_v_o);
18602 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
18603 __Pyx_GIVEREF(__pyx_t_1);
18604 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
18605 __Pyx_GIVEREF(__pyx_t_2);
18606 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18609 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
18610 __Pyx_GOTREF(__pyx_t_2);
18611 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18612 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
18622 __Pyx_TraceLine(661,0,__PYX_ERR(1, 661, __pyx_L1_error))
18623 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
18632 __Pyx_TraceLine(662,0,__PYX_ERR(1, 662, __pyx_L1_error))
18633 __Pyx_XDECREF(__pyx_r);
18634 __Pyx_INCREF(((PyObject *)__pyx_v_result));
18635 __pyx_r = ((PyObject *)__pyx_v_result);
18648 __Pyx_XDECREF(__pyx_t_1);
18649 __Pyx_XDECREF(__pyx_t_2);
18650 __Pyx_XDECREF(__pyx_t_3);
18651 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
18654 __Pyx_XDECREF((PyObject *)__pyx_v_result);
18655 __Pyx_XGIVEREF(__pyx_r);
18656 __Pyx_TraceReturn(__pyx_r, 0);
18657 __Pyx_RefNannyFinishContext();
18669 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
18671 __Pyx_TraceDeclarations
18672 __Pyx_RefNannyDeclarations
18674 int __pyx_lineno = 0;
18675 const char *__pyx_filename = NULL;
18676 int __pyx_clineno = 0;
18677 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
18678 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 665, 0, __PYX_ERR(1, 665, __pyx_L1_error));
18687 __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
18688 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
18689 __pyx_r = __pyx_t_1;
18702 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18705 __Pyx_TraceReturn(Py_None, 0);
18706 __Pyx_RefNannyFinishContext();
18718 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
18719 PyObject *__pyx_v_tup = NULL;
18720 PyObject *__pyx_v_result = NULL;
18721 int __pyx_v_have_slices;
18722 int __pyx_v_seen_ellipsis;
18723 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
18724 PyObject *__pyx_v_item = NULL;
18725 Py_ssize_t __pyx_v_nslices;
18726 PyObject *__pyx_r = NULL;
18727 __Pyx_TraceDeclarations
18728 __Pyx_RefNannyDeclarations
18731 PyObject *__pyx_t_3 = NULL;
18732 PyObject *__pyx_t_4 = NULL;
18733 Py_ssize_t __pyx_t_5;
18734 PyObject *(*__pyx_t_6)(PyObject *);
18735 PyObject *__pyx_t_7 = NULL;
18736 Py_ssize_t __pyx_t_8;
18739 PyObject *__pyx_t_11 = NULL;
18740 int __pyx_lineno = 0;
18741 const char *__pyx_filename = NULL;
18742 int __pyx_clineno = 0;
18743 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
18744 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 668, 0, __PYX_ERR(1, 668, __pyx_L1_error));
18753 __Pyx_TraceLine(673,0,__PYX_ERR(1, 673, __pyx_L1_error))
18754 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
18755 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
18765 __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
18766 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
18767 __Pyx_GOTREF(__pyx_t_3);
18768 __Pyx_INCREF(__pyx_v_index);
18769 __Pyx_GIVEREF(__pyx_v_index);
18770 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
18771 __pyx_v_tup = __pyx_t_3;
18791 __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
18793 __Pyx_INCREF(__pyx_v_index);
18794 __pyx_v_tup = __pyx_v_index;
18805 __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
18806 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
18807 __Pyx_GOTREF(__pyx_t_3);
18808 __pyx_v_result = ((PyObject*)__pyx_t_3);
18818 __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
18819 __pyx_v_have_slices = 0;
18828 __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
18829 __pyx_v_seen_ellipsis = 0;
18838 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
18839 __Pyx_INCREF(__pyx_int_0);
18840 __pyx_t_3 = __pyx_int_0;
18841 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
18842 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
18845 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
18846 __Pyx_GOTREF(__pyx_t_4);
18847 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
18850 if (likely(!__pyx_t_6)) {
18851 if (likely(PyList_CheckExact(__pyx_t_4))) {
18852 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
18853 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18854 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
18856 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
18857 __Pyx_GOTREF(__pyx_t_7);
18860 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
18861 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18862 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
18864 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
18865 __Pyx_GOTREF(__pyx_t_7);
18869 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
18870 if (unlikely(!__pyx_t_7)) {
18871 PyObject* exc_type = PyErr_Occurred();
18873 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18874 else __PYX_ERR(1, 681, __pyx_L1_error)
18878 __Pyx_GOTREF(__pyx_t_7);
18880 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
18882 __Pyx_INCREF(__pyx_t_3);
18883 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
18884 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
18885 __Pyx_GOTREF(__pyx_t_7);
18886 __Pyx_DECREF(__pyx_t_3);
18887 __pyx_t_3 = __pyx_t_7;
18897 __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
18898 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
18899 __pyx_t_1 = (__pyx_t_2 != 0);
18909 __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
18910 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
18920 __Pyx_TraceLine(684,0,__PYX_ERR(1, 684, __pyx_L1_error))
18921 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
18922 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
18923 __Pyx_GOTREF(__pyx_t_7);
18924 { Py_ssize_t __pyx_temp;
18925 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
18926 __Pyx_INCREF(__pyx_slice__36);
18927 __Pyx_GIVEREF(__pyx_slice__36);
18928 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__36);
18931 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
18932 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18941 __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
18942 __pyx_v_seen_ellipsis = 1;
18961 __Pyx_TraceLine(687,0,__PYX_ERR(1, 687, __pyx_L1_error))
18963 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__36);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
18974 __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
18975 __pyx_v_have_slices = 1;
18994 __Pyx_TraceLine(690,0,__PYX_ERR(1, 690, __pyx_L1_error))
18996 __pyx_t_2 = PySlice_Check(__pyx_v_item);
18997 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
19000 __pyx_t_1 = __pyx_t_10;
19001 goto __pyx_L9_bool_binop_done;
19003 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
19004 __pyx_t_1 = __pyx_t_10;
19005 __pyx_L9_bool_binop_done:;
19006 if (unlikely(__pyx_t_1)) {
19015 __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
19016 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
19017 __Pyx_GOTREF(__pyx_t_7);
19018 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
19019 __Pyx_GOTREF(__pyx_t_11);
19020 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19021 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
19022 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
19023 __PYX_ERR(1, 691, __pyx_L1_error)
19041 __Pyx_TraceLine(693,0,__PYX_ERR(1, 693, __pyx_L1_error))
19042 __pyx_t_10 = (__pyx_v_have_slices != 0);
19045 __pyx_t_1 = __pyx_t_10;
19046 goto __pyx_L11_bool_binop_done;
19048 __pyx_t_10 = PySlice_Check(__pyx_v_item);
19049 __pyx_t_2 = (__pyx_t_10 != 0);
19050 __pyx_t_1 = __pyx_t_2;
19051 __pyx_L11_bool_binop_done:;
19052 __pyx_v_have_slices = __pyx_t_1;
19061 __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
19062 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
19073 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
19075 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19076 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19085 __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
19086 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
19087 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
19096 __Pyx_TraceLine(697,0,__PYX_ERR(1, 697, __pyx_L1_error))
19097 __pyx_t_1 = (__pyx_v_nslices != 0);
19107 __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
19108 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
19109 __Pyx_GOTREF(__pyx_t_3);
19110 { Py_ssize_t __pyx_temp;
19111 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
19112 __Pyx_INCREF(__pyx_slice__36);
19113 __Pyx_GIVEREF(__pyx_slice__36);
19114 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__36);
19117 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
19118 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19136 __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
19137 __Pyx_XDECREF(__pyx_r);
19138 if (!__pyx_v_have_slices) {
19140 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
19141 __Pyx_GOTREF(__pyx_t_4);
19142 __pyx_t_3 = __pyx_t_4;
19144 goto __pyx_L14_bool_binop_done;
19146 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
19147 __Pyx_GOTREF(__pyx_t_4);
19148 __pyx_t_3 = __pyx_t_4;
19150 __pyx_L14_bool_binop_done:;
19151 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
19152 __Pyx_GOTREF(__pyx_t_4);
19153 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
19154 __Pyx_GOTREF(__pyx_t_11);
19155 __Pyx_GIVEREF(__pyx_t_3);
19156 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
19157 __Pyx_GIVEREF(__pyx_t_4);
19158 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
19161 __pyx_r = ((PyObject*)__pyx_t_11);
19175 __Pyx_XDECREF(__pyx_t_3);
19176 __Pyx_XDECREF(__pyx_t_4);
19177 __Pyx_XDECREF(__pyx_t_7);
19178 __Pyx_XDECREF(__pyx_t_11);
19179 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
19182 __Pyx_XDECREF(__pyx_v_tup);
19183 __Pyx_XDECREF(__pyx_v_result);
19184 __Pyx_XDECREF(__pyx_v_idx);
19185 __Pyx_XDECREF(__pyx_v_item);
19186 __Pyx_XGIVEREF(__pyx_r);
19187 __Pyx_TraceReturn(__pyx_r, 0);
19188 __Pyx_RefNannyFinishContext();
19200 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
19201 Py_ssize_t __pyx_v_suboffset;
19202 PyObject *__pyx_r = NULL;
19203 __Pyx_TraceDeclarations
19204 __Pyx_RefNannyDeclarations
19205 Py_ssize_t *__pyx_t_1;
19206 Py_ssize_t *__pyx_t_2;
19207 Py_ssize_t *__pyx_t_3;
19209 PyObject *__pyx_t_5 = NULL;
19210 int __pyx_lineno = 0;
19211 const char *__pyx_filename = NULL;
19212 int __pyx_clineno = 0;
19213 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
19214 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 702, 0, __PYX_ERR(1, 702, __pyx_L1_error));
19223 __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
19224 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
19225 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
19226 __pyx_t_1 = __pyx_t_3;
19227 __pyx_v_suboffset = (__pyx_t_1[0]);
19236 __Pyx_TraceLine(704,0,__PYX_ERR(1, 704, __pyx_L1_error))
19237 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
19238 if (unlikely(__pyx_t_4)) {
19247 __Pyx_TraceLine(705,0,__PYX_ERR(1, 705, __pyx_L1_error))
19248 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
19249 __Pyx_GOTREF(__pyx_t_5);
19250 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
19251 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19252 __PYX_ERR(1, 705, __pyx_L1_error)
19273 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19276 __Pyx_XDECREF(__pyx_t_5);
19277 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
19280 __Pyx_XGIVEREF(__pyx_r);
19281 __Pyx_TraceReturn(__pyx_r, 0);
19282 __Pyx_RefNannyFinishContext();
19294 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
19295 int __pyx_v_new_ndim;
19296 int __pyx_v_suboffset_dim;
19298 __Pyx_memviewslice __pyx_v_src;
19299 __Pyx_memviewslice __pyx_v_dst;
19300 __Pyx_memviewslice *__pyx_v_p_src;
19301 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
19302 __Pyx_memviewslice *__pyx_v_p_dst;
19303 int *__pyx_v_p_suboffset_dim;
19304 Py_ssize_t __pyx_v_start;
19305 Py_ssize_t __pyx_v_stop;
19306 Py_ssize_t __pyx_v_step;
19307 int __pyx_v_have_start;
19308 int __pyx_v_have_stop;
19309 int __pyx_v_have_step;
19310 PyObject *__pyx_v_index = NULL;
19311 struct __pyx_memoryview_obj *__pyx_r = NULL;
19312 __Pyx_TraceDeclarations
19313 __Pyx_RefNannyDeclarations
19316 PyObject *__pyx_t_3 = NULL;
19317 struct __pyx_memoryview_obj *__pyx_t_4;
19320 Py_ssize_t __pyx_t_7;
19321 PyObject *(*__pyx_t_8)(PyObject *);
19322 PyObject *__pyx_t_9 = NULL;
19323 Py_ssize_t __pyx_t_10;
19325 Py_ssize_t __pyx_t_12;
19326 int __pyx_lineno = 0;
19327 const char *__pyx_filename = NULL;
19328 int __pyx_clineno = 0;
19329 __Pyx_RefNannySetupContext(
"memview_slice", 0);
19330 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 712, 0, __PYX_ERR(1, 712, __pyx_L1_error));
19339 __Pyx_TraceLine(713,0,__PYX_ERR(1, 713, __pyx_L1_error))
19340 __pyx_v_new_ndim = 0;
19341 __pyx_v_suboffset_dim = -1;
19350 __Pyx_TraceLine(720,0,__PYX_ERR(1, 720, __pyx_L1_error))
19351 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
19360 __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
19361 #ifndef CYTHON_WITHOUT_ASSERTIONS
19362 if (unlikely(__pyx_assertions_enabled())) {
19363 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
19364 PyErr_SetNone(PyExc_AssertionError);
19365 __PYX_ERR(1, 724, __pyx_L1_error)
19377 __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
19378 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19379 __pyx_t_2 = (__pyx_t_1 != 0);
19389 __Pyx_TraceLine(727,0,__PYX_ERR(1, 727, __pyx_L1_error))
19390 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
19391 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
19392 __Pyx_INCREF(__pyx_t_3);
19393 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
19403 __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
19404 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
19423 __Pyx_TraceLine(730,0,__PYX_ERR(1, 730, __pyx_L1_error))
19425 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
19434 __Pyx_TraceLine(731,0,__PYX_ERR(1, 731, __pyx_L1_error))
19435 __pyx_v_p_src = (&__pyx_v_src);
19446 __Pyx_TraceLine(737,0,__PYX_ERR(1, 737, __pyx_L1_error))
19447 __pyx_t_4 = __pyx_v_p_src->memview;
19448 __pyx_v_dst.memview = __pyx_t_4;
19457 __Pyx_TraceLine(738,0,__PYX_ERR(1, 738, __pyx_L1_error))
19458 __pyx_t_5 = __pyx_v_p_src->data;
19459 __pyx_v_dst.data = __pyx_t_5;
19468 __Pyx_TraceLine(743,0,__PYX_ERR(1, 743, __pyx_L1_error))
19469 __pyx_v_p_dst = (&__pyx_v_dst);
19478 __Pyx_TraceLine(744,0,__PYX_ERR(1, 744, __pyx_L1_error))
19479 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
19488 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
19490 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
19491 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
19494 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
19495 __Pyx_GOTREF(__pyx_t_3);
19496 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
19499 if (likely(!__pyx_t_8)) {
19500 if (likely(PyList_CheckExact(__pyx_t_3))) {
19501 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
19502 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19503 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
19505 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
19506 __Pyx_GOTREF(__pyx_t_9);
19509 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
19510 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19511 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
19513 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
19514 __Pyx_GOTREF(__pyx_t_9);
19518 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
19519 if (unlikely(!__pyx_t_9)) {
19520 PyObject* exc_type = PyErr_Occurred();
19522 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
19523 else __PYX_ERR(1, 748, __pyx_L1_error)
19527 __Pyx_GOTREF(__pyx_t_9);
19529 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
19531 __pyx_v_dim = __pyx_t_6;
19532 __pyx_t_6 = (__pyx_t_6 + 1);
19541 __Pyx_TraceLine(749,0,__PYX_ERR(1, 749, __pyx_L1_error))
19542 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
19552 __Pyx_TraceLine(753,0,__PYX_ERR(1, 753, __pyx_L1_error))
19553 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
19562 __Pyx_TraceLine(750,0,__PYX_ERR(1, 750, __pyx_L1_error))
19563 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
19582 __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
19583 __pyx_t_2 = (__pyx_v_index == Py_None);
19584 __pyx_t_1 = (__pyx_t_2 != 0);
19594 __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
19595 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
19604 __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
19605 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
19614 __Pyx_TraceLine(759,0,__PYX_ERR(1, 759, __pyx_L1_error))
19615 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
19624 __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
19625 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
19644 __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
19646 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
19647 __Pyx_GOTREF(__pyx_t_9);
19648 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
19650 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19652 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
19653 __pyx_t_10 = __pyx_t_12;
19654 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19655 goto __pyx_L7_bool_binop_done;
19658 __pyx_L7_bool_binop_done:;
19659 __pyx_v_start = __pyx_t_10;
19668 __Pyx_TraceLine(763,0,__PYX_ERR(1, 763, __pyx_L1_error))
19669 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
19670 __Pyx_GOTREF(__pyx_t_9);
19671 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
19673 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19675 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
19676 __pyx_t_10 = __pyx_t_12;
19677 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19678 goto __pyx_L9_bool_binop_done;
19681 __pyx_L9_bool_binop_done:;
19682 __pyx_v_stop = __pyx_t_10;
19691 __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
19692 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
19693 __Pyx_GOTREF(__pyx_t_9);
19694 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
19696 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19698 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
19699 __pyx_t_10 = __pyx_t_12;
19700 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19701 goto __pyx_L11_bool_binop_done;
19704 __pyx_L11_bool_binop_done:;
19705 __pyx_v_step = __pyx_t_10;
19714 __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
19715 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
19716 __Pyx_GOTREF(__pyx_t_9);
19717 __pyx_t_1 = (__pyx_t_9 != Py_None);
19718 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19719 __pyx_v_have_start = __pyx_t_1;
19728 __Pyx_TraceLine(767,0,__PYX_ERR(1, 767, __pyx_L1_error))
19729 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
19730 __Pyx_GOTREF(__pyx_t_9);
19731 __pyx_t_1 = (__pyx_t_9 != Py_None);
19732 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19733 __pyx_v_have_stop = __pyx_t_1;
19742 __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
19743 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
19744 __Pyx_GOTREF(__pyx_t_9);
19745 __pyx_t_1 = (__pyx_t_9 != Py_None);
19746 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19747 __pyx_v_have_step = __pyx_t_1;
19756 __Pyx_TraceLine(770,0,__PYX_ERR(1, 770, __pyx_L1_error))
19757 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
19766 __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
19767 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
19778 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
19780 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19789 __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
19790 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19791 __pyx_t_2 = (__pyx_t_1 != 0);
19801 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
19802 __Pyx_XDECREF(((PyObject *)__pyx_r));
19811 __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error))
19812 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
19821 __Pyx_TraceLine(781,0,__PYX_ERR(1, 781, __pyx_L1_error))
19822 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
19831 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
19832 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
19833 __Pyx_GOTREF(__pyx_t_3);
19834 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
19835 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
19855 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
19857 __Pyx_XDECREF(((PyObject *)__pyx_r));
19866 __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error))
19867 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
19868 __Pyx_GOTREF(__pyx_t_3);
19877 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
19878 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
19879 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
19894 __Pyx_XDECREF(__pyx_t_3);
19895 __Pyx_XDECREF(__pyx_t_9);
19896 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19899 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
19900 __Pyx_XDECREF(__pyx_v_index);
19901 __Pyx_XGIVEREF((PyObject *)__pyx_r);
19902 __Pyx_TraceReturn(__pyx_r, 0);
19903 __Pyx_RefNannyFinishContext();
19915 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
19916 Py_ssize_t __pyx_v_new_shape;
19917 int __pyx_v_negative_step;
19919 __Pyx_TraceDeclarations
19923 int __pyx_lineno = 0;
19924 const char *__pyx_filename = NULL;
19925 int __pyx_clineno = 0;
19926 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 809, 1, __PYX_ERR(1, 809, __pyx_L1_error));
19935 __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
19936 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
19946 __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
19947 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
19957 __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
19958 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
19976 __Pyx_TraceLine(833,1,__PYX_ERR(1, 833, __pyx_L1_error))
19977 __pyx_t_1 = (0 <= __pyx_v_start);
19979 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
19981 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
19991 __Pyx_TraceLine(834,1,__PYX_ERR(1, 834, __pyx_L1_error))
19992 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
20020 __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
20022 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
20025 __pyx_t_2 = __pyx_t_1;
20026 goto __pyx_L6_bool_binop_done;
20028 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
20029 __pyx_t_2 = __pyx_t_1;
20030 __pyx_L6_bool_binop_done:;
20031 __pyx_v_negative_step = __pyx_t_2;
20040 __Pyx_TraceLine(839,1,__PYX_ERR(1, 839, __pyx_L1_error))
20041 __pyx_t_1 = (__pyx_v_have_step != 0);
20044 __pyx_t_2 = __pyx_t_1;
20045 goto __pyx_L9_bool_binop_done;
20047 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
20048 __pyx_t_2 = __pyx_t_1;
20049 __pyx_L9_bool_binop_done:;
20059 __Pyx_TraceLine(840,1,__PYX_ERR(1, 840, __pyx_L1_error))
20060 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
20078 __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
20079 __pyx_t_2 = (__pyx_v_have_start != 0);
20089 __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
20090 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
20100 __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
20101 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
20110 __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
20111 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
20121 __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
20150 __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
20151 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
20161 __Pyx_TraceLine(849,1,__PYX_ERR(1, 849, __pyx_L1_error))
20162 __pyx_t_2 = (__pyx_v_negative_step != 0);
20172 __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
20173 __pyx_v_start = (__pyx_v_shape - 1);
20192 __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
20194 __pyx_v_start = __pyx_v_shape;
20225 __Pyx_TraceLine(854,1,__PYX_ERR(1, 854, __pyx_L1_error))
20227 __pyx_t_2 = (__pyx_v_negative_step != 0);
20237 __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
20238 __pyx_v_start = (__pyx_v_shape - 1);
20257 __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
20272 __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
20273 __pyx_t_2 = (__pyx_v_have_stop != 0);
20283 __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
20284 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
20294 __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
20295 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
20304 __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
20305 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
20315 __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
20344 __Pyx_TraceLine(864,1,__PYX_ERR(1, 864, __pyx_L1_error))
20345 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
20355 __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
20356 __pyx_v_stop = __pyx_v_shape;
20385 __Pyx_TraceLine(867,1,__PYX_ERR(1, 867, __pyx_L1_error))
20387 __pyx_t_2 = (__pyx_v_negative_step != 0);
20397 __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
20398 __pyx_v_stop = -1L;
20417 __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
20419 __pyx_v_stop = __pyx_v_shape;
20432 __Pyx_TraceLine(872,1,__PYX_ERR(1, 872, __pyx_L1_error))
20433 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
20443 __Pyx_TraceLine(873,1,__PYX_ERR(1, 873, __pyx_L1_error))
20462 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
20471 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
20481 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
20499 __Pyx_TraceLine(882,1,__PYX_ERR(1, 882, __pyx_L1_error))
20500 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
20510 __Pyx_TraceLine(883,1,__PYX_ERR(1, 883, __pyx_L1_error))
20511 __pyx_v_new_shape = 0;
20529 __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
20530 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
20539 __Pyx_TraceLine(887,1,__PYX_ERR(1, 887, __pyx_L1_error))
20540 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
20549 __Pyx_TraceLine(888,1,__PYX_ERR(1, 888, __pyx_L1_error))
20550 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
20561 __Pyx_TraceLine(891,1,__PYX_ERR(1, 891, __pyx_L1_error))
20562 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
20572 __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
20573 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
20592 __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
20594 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
20595 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
20606 __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
20607 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
20617 __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
20618 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
20628 __Pyx_TraceLine(898,1,__PYX_ERR(1, 898, __pyx_L1_error))
20629 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
20639 __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
20640 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
20659 __Pyx_TraceLine(901,1,__PYX_ERR(1, 901, __pyx_L1_error))
20669 __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
20670 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
20691 __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
20693 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
20713 __Pyx_TraceLine(906,1,__PYX_ERR(1, 906, __pyx_L1_error))
20729 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20731 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20733 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20738 __Pyx_TraceReturn(Py_None, 1);
20750 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
20751 Py_ssize_t __pyx_v_shape;
20752 Py_ssize_t __pyx_v_stride;
20753 Py_ssize_t __pyx_v_suboffset;
20754 Py_ssize_t __pyx_v_itemsize;
20755 char *__pyx_v_resultp;
20757 __Pyx_TraceDeclarations
20758 __Pyx_RefNannyDeclarations
20759 Py_ssize_t __pyx_t_1;
20761 PyObject *__pyx_t_3 = NULL;
20762 PyObject *__pyx_t_4 = NULL;
20763 int __pyx_lineno = 0;
20764 const char *__pyx_filename = NULL;
20765 int __pyx_clineno = 0;
20766 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
20767 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 912, 0, __PYX_ERR(1, 912, __pyx_L1_error));
20776 __Pyx_TraceLine(914,0,__PYX_ERR(1, 914, __pyx_L1_error))
20777 __pyx_v_suboffset = -1L;
20786 __Pyx_TraceLine(915,0,__PYX_ERR(1, 915, __pyx_L1_error))
20787 __pyx_t_1 = __pyx_v_view->itemsize;
20788 __pyx_v_itemsize = __pyx_t_1;
20797 __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
20798 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
20808 __Pyx_TraceLine(919,0,__PYX_ERR(1, 919, __pyx_L1_error))
20809 if (unlikely(__pyx_v_itemsize == 0)) {
20810 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
20811 __PYX_ERR(1, 919, __pyx_L1_error)
20813 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
20814 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
20815 __PYX_ERR(1, 919, __pyx_L1_error)
20817 __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
20826 __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
20827 __pyx_v_stride = __pyx_v_itemsize;
20846 __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
20848 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
20857 __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
20858 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
20867 __Pyx_TraceLine(924,0,__PYX_ERR(1, 924, __pyx_L1_error))
20868 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
20878 __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
20879 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
20899 __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
20900 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
20910 __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
20911 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
20920 __Pyx_TraceLine(929,0,__PYX_ERR(1, 929, __pyx_L1_error))
20921 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
20922 if (unlikely(__pyx_t_2)) {
20931 __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
20932 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
20933 __Pyx_GOTREF(__pyx_t_3);
20934 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
20935 __Pyx_GOTREF(__pyx_t_4);
20936 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20937 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
20938 __Pyx_GOTREF(__pyx_t_3);
20939 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20940 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20941 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20942 __PYX_ERR(1, 930, __pyx_L1_error)
20969 __Pyx_TraceLine(932,0,__PYX_ERR(1, 932, __pyx_L1_error))
20970 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
20971 if (unlikely(__pyx_t_2)) {
20980 __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
20981 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
20982 __Pyx_GOTREF(__pyx_t_3);
20983 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
20984 __Pyx_GOTREF(__pyx_t_4);
20985 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20986 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
20987 __Pyx_GOTREF(__pyx_t_3);
20988 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20989 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20990 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20991 __PYX_ERR(1, 933, __pyx_L1_error)
21009 __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
21010 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
21019 __Pyx_TraceLine(936,0,__PYX_ERR(1, 936, __pyx_L1_error))
21020 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
21030 __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
21031 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
21049 __Pyx_TraceLine(939,0,__PYX_ERR(1, 939, __pyx_L1_error))
21050 __pyx_r = __pyx_v_resultp;
21063 __Pyx_XDECREF(__pyx_t_3);
21064 __Pyx_XDECREF(__pyx_t_4);
21065 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
21068 __Pyx_TraceReturn(Py_None, 0);
21069 __Pyx_RefNannyFinishContext();
21081 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
21083 Py_ssize_t *__pyx_v_shape;
21084 Py_ssize_t *__pyx_v_strides;
21088 __Pyx_TraceDeclarations
21090 Py_ssize_t *__pyx_t_2;
21093 Py_ssize_t __pyx_t_5;
21094 Py_ssize_t __pyx_t_6;
21098 int __pyx_lineno = 0;
21099 const char *__pyx_filename = NULL;
21100 int __pyx_clineno = 0;
21101 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 945, 1, __PYX_ERR(1, 945, __pyx_L1_error));
21110 __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
21111 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
21112 __pyx_v_ndim = __pyx_t_1;
21121 __Pyx_TraceLine(948,1,__PYX_ERR(1, 948, __pyx_L1_error))
21122 __pyx_t_2 = __pyx_v_memslice->shape;
21123 __pyx_v_shape = __pyx_t_2;
21132 __Pyx_TraceLine(949,1,__PYX_ERR(1, 949, __pyx_L1_error))
21133 __pyx_t_2 = __pyx_v_memslice->strides;
21134 __pyx_v_strides = __pyx_t_2;
21143 __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
21144 __pyx_t_3 = (__pyx_v_ndim / 2);
21145 __pyx_t_4 = __pyx_t_3;
21146 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
21147 __pyx_v_i = __pyx_t_1;
21156 __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
21157 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
21166 __Pyx_TraceLine(955,1,__PYX_ERR(1, 955, __pyx_L1_error))
21167 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
21168 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
21169 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
21170 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
21179 __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
21180 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
21181 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
21182 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
21183 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
21192 __Pyx_TraceLine(958,1,__PYX_ERR(1, 958, __pyx_L1_error))
21193 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
21196 __pyx_t_7 = __pyx_t_8;
21197 goto __pyx_L6_bool_binop_done;
21199 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
21200 __pyx_t_7 = __pyx_t_8;
21201 __pyx_L6_bool_binop_done:;
21211 __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
21212 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
21231 __Pyx_TraceLine(961,1,__PYX_ERR(1, 961, __pyx_L1_error))
21247 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21249 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21251 __Pyx_PyGILState_Release(__pyx_gilstate_save);
21256 __Pyx_TraceReturn(Py_None, 1);
21269 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
21270 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
21271 __Pyx_RefNannyDeclarations
21272 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
21273 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21276 __Pyx_RefNannyFinishContext();
21279 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21280 __Pyx_TraceDeclarations
21281 __Pyx_RefNannyDeclarations
21282 int __pyx_lineno = 0;
21283 const char *__pyx_filename = NULL;
21284 int __pyx_clineno = 0;
21285 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
21286 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 978, 0, __PYX_ERR(1, 978, __pyx_L1_error));
21295 __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
21296 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
21309 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
21311 __Pyx_TraceReturn(Py_None, 0);
21312 __Pyx_RefNannyFinishContext();
21323 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
21324 PyObject *__pyx_r = NULL;
21325 __Pyx_TraceDeclarations
21326 __Pyx_RefNannyDeclarations
21328 PyObject *__pyx_t_2 = NULL;
21329 int __pyx_lineno = 0;
21330 const char *__pyx_filename = NULL;
21331 int __pyx_clineno = 0;
21332 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
21333 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
21342 __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L1_error))
21343 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
21353 __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
21354 __Pyx_XDECREF(__pyx_r);
21355 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
21356 __Pyx_GOTREF(__pyx_t_2);
21357 __pyx_r = __pyx_t_2;
21377 __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
21379 __Pyx_XDECREF(__pyx_r);
21380 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
21381 __Pyx_GOTREF(__pyx_t_2);
21382 __pyx_r = __pyx_t_2;
21397 __Pyx_XDECREF(__pyx_t_2);
21398 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21401 __Pyx_XGIVEREF(__pyx_r);
21402 __Pyx_TraceReturn(__pyx_r, 0);
21403 __Pyx_RefNannyFinishContext();
21415 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
21416 PyObject *__pyx_r = NULL;
21417 __Pyx_TraceDeclarations
21418 __Pyx_RefNannyDeclarations
21421 PyObject *__pyx_t_3 = NULL;
21422 int __pyx_lineno = 0;
21423 const char *__pyx_filename = NULL;
21424 int __pyx_clineno = 0;
21425 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
21426 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 987, 0, __PYX_ERR(1, 987, __pyx_L1_error));
21435 __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L1_error))
21436 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
21446 __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
21447 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
21466 __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error))
21468 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
21469 __Pyx_GOTREF(__pyx_t_3);
21470 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21483 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21486 __Pyx_XDECREF(__pyx_t_3);
21487 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21490 __Pyx_XGIVEREF(__pyx_r);
21491 __Pyx_TraceReturn(__pyx_r, 0);
21492 __Pyx_RefNannyFinishContext();
21505 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
21506 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
21507 PyObject *__pyx_r = 0;
21508 __Pyx_RefNannyDeclarations
21509 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
21510 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21513 __Pyx_RefNannyFinishContext();
21517 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21518 PyObject *__pyx_r = NULL;
21519 __Pyx_TraceDeclarations
21520 __Pyx_RefNannyDeclarations
21521 int __pyx_lineno = 0;
21522 const char *__pyx_filename = NULL;
21523 int __pyx_clineno = 0;
21524 __Pyx_RefNannySetupContext(
"__get__", 0);
21525 __Pyx_TraceCall(
"__get__", __pyx_f[1], 994, 0, __PYX_ERR(1, 994, __pyx_L1_error));
21534 __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
21535 __Pyx_XDECREF(__pyx_r);
21536 __Pyx_INCREF(__pyx_v_self->from_object);
21537 __pyx_r = __pyx_v_self->from_object;
21550 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21553 __Pyx_XGIVEREF(__pyx_r);
21554 __Pyx_TraceReturn(__pyx_r, 0);
21555 __Pyx_RefNannyFinishContext();
21566 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
21567 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
21568 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
21569 PyObject *__pyx_r = 0;
21570 __Pyx_RefNannyDeclarations
21571 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
21572 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21575 __Pyx_RefNannyFinishContext();
21579 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21580 PyObject *__pyx_r = NULL;
21581 __Pyx_TraceDeclarations
21582 __Pyx_RefNannyDeclarations
21583 PyObject *__pyx_t_1 = NULL;
21584 int __pyx_lineno = 0;
21585 const char *__pyx_filename = NULL;
21586 int __pyx_clineno = 0;
21587 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
21588 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
21596 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
21597 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
21598 __Pyx_GOTREF(__pyx_t_1);
21599 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21600 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21601 __PYX_ERR(1, 2, __pyx_L1_error)
21611 __Pyx_XDECREF(__pyx_t_1);
21612 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21614 __Pyx_XGIVEREF(__pyx_r);
21615 __Pyx_TraceReturn(__pyx_r, 0);
21616 __Pyx_RefNannyFinishContext();
21628 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
21629 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
21630 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
21631 PyObject *__pyx_r = 0;
21632 __Pyx_RefNannyDeclarations
21633 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
21634 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
21637 __Pyx_RefNannyFinishContext();
21641 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
21642 PyObject *__pyx_r = NULL;
21643 __Pyx_TraceDeclarations
21644 __Pyx_RefNannyDeclarations
21645 PyObject *__pyx_t_1 = NULL;
21646 int __pyx_lineno = 0;
21647 const char *__pyx_filename = NULL;
21648 int __pyx_clineno = 0;
21649 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
21650 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
21657 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
21658 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
21659 __Pyx_GOTREF(__pyx_t_1);
21660 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21661 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21662 __PYX_ERR(1, 4, __pyx_L1_error)
21673 __Pyx_XDECREF(__pyx_t_1);
21674 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21676 __Pyx_XGIVEREF(__pyx_r);
21677 __Pyx_TraceReturn(__pyx_r, 0);
21678 __Pyx_RefNannyFinishContext();
21690 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
21691 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
21692 Py_ssize_t __pyx_v_suboffset;
21693 PyObject *__pyx_v_length = NULL;
21694 PyObject *__pyx_r = NULL;
21695 __Pyx_TraceDeclarations
21696 __Pyx_RefNannyDeclarations
21698 PyObject *__pyx_t_2 = NULL;
21699 PyObject *__pyx_t_3 = NULL;
21700 __Pyx_TypeInfo *__pyx_t_4;
21701 Py_buffer __pyx_t_5;
21702 Py_ssize_t *__pyx_t_6;
21703 Py_ssize_t *__pyx_t_7;
21704 Py_ssize_t *__pyx_t_8;
21705 Py_ssize_t __pyx_t_9;
21706 int __pyx_lineno = 0;
21707 const char *__pyx_filename = NULL;
21708 int __pyx_clineno = 0;
21709 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
21710 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 1001, 0, __PYX_ERR(1, 1001, __pyx_L1_error));
21719 __Pyx_TraceLine(1009,0,__PYX_ERR(1, 1009, __pyx_L1_error))
21720 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
21730 __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error))
21731 __Pyx_XDECREF(__pyx_r);
21732 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21751 __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
21752 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
21753 __Pyx_GOTREF(__pyx_t_2);
21754 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
21755 __Pyx_GOTREF(__pyx_t_3);
21756 __Pyx_INCREF(Py_None);
21757 __Pyx_GIVEREF(Py_None);
21758 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
21759 __Pyx_INCREF(__pyx_int_0);
21760 __Pyx_GIVEREF(__pyx_int_0);
21761 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
21762 __Pyx_GIVEREF(__pyx_t_2);
21763 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
21765 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
21766 __Pyx_GOTREF(__pyx_t_2);
21767 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21768 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
21778 __Pyx_TraceLine(1017,0,__PYX_ERR(1, 1017, __pyx_L1_error))
21779 __pyx_v_result->from_slice = __pyx_v_memviewslice;
21788 __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
21789 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
21798 __Pyx_TraceLine(1020,0,__PYX_ERR(1, 1020, __pyx_L1_error))
21799 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
21800 __Pyx_GOTREF(__pyx_t_2);
21801 __Pyx_GIVEREF(__pyx_t_2);
21802 __Pyx_GOTREF(__pyx_v_result->from_object);
21803 __Pyx_DECREF(__pyx_v_result->from_object);
21804 __pyx_v_result->from_object = __pyx_t_2;
21814 __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
21815 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
21816 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
21825 __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
21826 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
21827 __pyx_v_result->__pyx_base.view = __pyx_t_5;
21836 __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
21837 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
21846 __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
21847 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
21856 __Pyx_TraceLine(1026,0,__PYX_ERR(1, 1026, __pyx_L1_error))
21857 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
21866 __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
21867 Py_INCREF(Py_None);
21876 __Pyx_TraceLine(1029,0,__PYX_ERR(1, 1029, __pyx_L1_error))
21877 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
21887 __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
21888 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
21907 __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
21909 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
21920 __Pyx_TraceLine(1034,0,__PYX_ERR(1, 1034, __pyx_L1_error))
21921 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
21930 __Pyx_TraceLine(1035,0,__PYX_ERR(1, 1035, __pyx_L1_error))
21931 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
21940 __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
21941 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
21950 __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
21951 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
21952 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
21953 __pyx_t_6 = __pyx_t_8;
21954 __pyx_v_suboffset = (__pyx_t_6[0]);
21963 __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
21964 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
21974 __Pyx_TraceLine(1041,0,__PYX_ERR(1, 1041, __pyx_L1_error))
21975 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
21984 __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
21985 goto __pyx_L6_break;
22005 __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
22006 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
22007 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
22016 __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error))
22017 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
22018 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
22019 __pyx_t_6 = __pyx_t_8;
22020 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
22021 __Pyx_GOTREF(__pyx_t_2);
22022 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
22032 __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
22033 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
22034 __Pyx_GOTREF(__pyx_t_2);
22035 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
22036 __Pyx_GOTREF(__pyx_t_3);
22037 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22038 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
22039 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22040 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
22050 __Pyx_TraceLine(1048,0,__PYX_ERR(1, 1048, __pyx_L1_error))
22051 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
22060 __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
22061 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
22070 __Pyx_TraceLine(1051,0,__PYX_ERR(1, 1051, __pyx_L1_error))
22071 __Pyx_XDECREF(__pyx_r);
22072 __Pyx_INCREF(((PyObject *)__pyx_v_result));
22073 __pyx_r = ((PyObject *)__pyx_v_result);
22086 __Pyx_XDECREF(__pyx_t_2);
22087 __Pyx_XDECREF(__pyx_t_3);
22088 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22091 __Pyx_XDECREF((PyObject *)__pyx_v_result);
22092 __Pyx_XDECREF(__pyx_v_length);
22093 __Pyx_XGIVEREF(__pyx_r);
22094 __Pyx_TraceReturn(__pyx_r, 0);
22095 __Pyx_RefNannyFinishContext();
22107 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
22108 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
22109 __Pyx_memviewslice *__pyx_r;
22110 __Pyx_TraceDeclarations
22111 __Pyx_RefNannyDeclarations
22114 PyObject *__pyx_t_3 = NULL;
22115 int __pyx_lineno = 0;
22116 const char *__pyx_filename = NULL;
22117 int __pyx_clineno = 0;
22118 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
22119 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1054, 0, __PYX_ERR(1, 1054, __pyx_L1_error));
22128 __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
22129 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
22130 __pyx_t_2 = (__pyx_t_1 != 0);
22140 __Pyx_TraceLine(1058,0,__PYX_ERR(1, 1058, __pyx_L1_error))
22141 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
22142 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
22143 __Pyx_INCREF(__pyx_t_3);
22144 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
22154 __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
22155 __pyx_r = (&__pyx_v_obj->from_slice);
22174 __Pyx_TraceLine(1061,0,__PYX_ERR(1, 1061, __pyx_L1_error))
22176 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
22185 __Pyx_TraceLine(1062,0,__PYX_ERR(1, 1062, __pyx_L1_error))
22186 __pyx_r = __pyx_v_mslice;
22200 __Pyx_XDECREF(__pyx_t_3);
22201 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
22204 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
22205 __Pyx_TraceReturn(Py_None, 0);
22206 __Pyx_RefNannyFinishContext();
22218 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
22220 Py_ssize_t *__pyx_v_shape;
22221 Py_ssize_t *__pyx_v_strides;
22222 Py_ssize_t *__pyx_v_suboffsets;
22223 __Pyx_TraceDeclarations
22224 __Pyx_RefNannyDeclarations
22225 Py_ssize_t *__pyx_t_1;
22229 Py_ssize_t __pyx_t_5;
22230 int __pyx_lineno = 0;
22231 const char *__pyx_filename = NULL;
22232 int __pyx_clineno = 0;
22233 __Pyx_RefNannySetupContext(
"slice_copy", 0);
22234 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1065, 0, __PYX_ERR(1, 1065, __pyx_L1_error));
22243 __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
22244 __pyx_t_1 = __pyx_v_memview->view.shape;
22245 __pyx_v_shape = __pyx_t_1;
22254 __Pyx_TraceLine(1070,0,__PYX_ERR(1, 1070, __pyx_L1_error))
22255 __pyx_t_1 = __pyx_v_memview->view.strides;
22256 __pyx_v_strides = __pyx_t_1;
22265 __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
22266 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
22267 __pyx_v_suboffsets = __pyx_t_1;
22276 __Pyx_TraceLine(1073,0,__PYX_ERR(1, 1073, __pyx_L1_error))
22277 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
22286 __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
22287 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
22296 __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
22297 __pyx_t_2 = __pyx_v_memview->view.ndim;
22298 __pyx_t_3 = __pyx_t_2;
22299 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22300 __pyx_v_dim = __pyx_t_4;
22309 __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
22310 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
22319 __Pyx_TraceLine(1078,0,__PYX_ERR(1, 1078, __pyx_L1_error))
22320 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
22329 __Pyx_TraceLine(1079,0,__PYX_ERR(1, 1079, __pyx_L1_error))
22330 if ((__pyx_v_suboffsets != 0)) {
22331 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
22335 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
22349 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
22351 __Pyx_TraceReturn(Py_None, 0);
22352 __Pyx_RefNannyFinishContext();
22363 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
22364 __Pyx_memviewslice __pyx_v_memviewslice;
22365 PyObject *__pyx_r = NULL;
22366 __Pyx_TraceDeclarations
22367 __Pyx_RefNannyDeclarations
22368 PyObject *__pyx_t_1 = NULL;
22369 int __pyx_lineno = 0;
22370 const char *__pyx_filename = NULL;
22371 int __pyx_clineno = 0;
22372 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
22373 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1082, 0, __PYX_ERR(1, 1082, __pyx_L1_error));
22382 __Pyx_TraceLine(1085,0,__PYX_ERR(1, 1085, __pyx_L1_error))
22383 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
22392 __Pyx_TraceLine(1086,0,__PYX_ERR(1, 1086, __pyx_L1_error))
22393 __Pyx_XDECREF(__pyx_r);
22394 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
22395 __Pyx_GOTREF(__pyx_t_1);
22396 __pyx_r = __pyx_t_1;
22410 __Pyx_XDECREF(__pyx_t_1);
22411 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
22414 __Pyx_XGIVEREF(__pyx_r);
22415 __Pyx_TraceReturn(__pyx_r, 0);
22416 __Pyx_RefNannyFinishContext();
22428 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
22429 PyObject *(*__pyx_v_to_object_func)(
char *);
22430 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
22431 PyObject *__pyx_r = NULL;
22432 __Pyx_TraceDeclarations
22433 __Pyx_RefNannyDeclarations
22436 PyObject *(*__pyx_t_3)(
char *);
22437 int (*__pyx_t_4)(
char *, PyObject *);
22438 PyObject *__pyx_t_5 = NULL;
22439 int __pyx_lineno = 0;
22440 const char *__pyx_filename = NULL;
22441 int __pyx_clineno = 0;
22442 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
22443 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1089, 0, __PYX_ERR(1, 1089, __pyx_L1_error));
22452 __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
22453 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
22454 __pyx_t_2 = (__pyx_t_1 != 0);
22464 __Pyx_TraceLine(1097,0,__PYX_ERR(1, 1097, __pyx_L1_error))
22465 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
22466 __pyx_v_to_object_func = __pyx_t_3;
22475 __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
22476 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
22477 __pyx_v_to_dtype_func = __pyx_t_4;
22496 __Pyx_TraceLine(1100,0,__PYX_ERR(1, 1100, __pyx_L1_error))
22498 __pyx_v_to_object_func = NULL;
22507 __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
22508 __pyx_v_to_dtype_func = NULL;
22519 __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
22520 __Pyx_XDECREF(__pyx_r);
22529 __Pyx_TraceLine(1105,0,__PYX_ERR(1, 1105, __pyx_L1_error))
22530 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
22531 __Pyx_GOTREF(__pyx_t_5);
22532 __pyx_r = __pyx_t_5;
22546 __Pyx_XDECREF(__pyx_t_5);
22547 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22550 __Pyx_XGIVEREF(__pyx_r);
22551 __Pyx_TraceReturn(__pyx_r, 0);
22552 __Pyx_RefNannyFinishContext();
22564 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
22565 Py_ssize_t __pyx_r;
22566 __Pyx_TraceDeclarations
22568 int __pyx_lineno = 0;
22569 const char *__pyx_filename = NULL;
22570 int __pyx_clineno = 0;
22571 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1111, 1, __PYX_ERR(1, 1111, __pyx_L1_error));
22580 __Pyx_TraceLine(1112,1,__PYX_ERR(1, 1112, __pyx_L1_error))
22581 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
22591 __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
22592 __pyx_r = (-__pyx_v_arg);
22611 __Pyx_TraceLine(1115,1,__PYX_ERR(1, 1115, __pyx_L1_error))
22613 __pyx_r = __pyx_v_arg;
22627 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22630 __Pyx_TraceReturn(Py_None, 1);
22642 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
22644 Py_ssize_t __pyx_v_c_stride;
22645 Py_ssize_t __pyx_v_f_stride;
22647 __Pyx_TraceDeclarations
22652 int __pyx_lineno = 0;
22653 const char *__pyx_filename = NULL;
22654 int __pyx_clineno = 0;
22655 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1118, 1, __PYX_ERR(1, 1118, __pyx_L1_error));
22664 __Pyx_TraceLine(1123,1,__PYX_ERR(1, 1123, __pyx_L1_error))
22665 __pyx_v_c_stride = 0;
22674 __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
22675 __pyx_v_f_stride = 0;
22684 __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
22685 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
22686 __pyx_v_i = __pyx_t_1;
22695 __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
22696 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
22706 __Pyx_TraceLine(1128,1,__PYX_ERR(1, 1128, __pyx_L1_error))
22707 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
22716 __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
22717 goto __pyx_L4_break;
22737 __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
22738 __pyx_t_1 = __pyx_v_ndim;
22739 __pyx_t_3 = __pyx_t_1;
22740 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22741 __pyx_v_i = __pyx_t_4;
22750 __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
22751 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
22761 __Pyx_TraceLine(1133,1,__PYX_ERR(1, 1133, __pyx_L1_error))
22762 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
22771 __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
22772 goto __pyx_L7_break;
22792 __Pyx_TraceLine(1136,1,__PYX_ERR(1, 1136, __pyx_L1_error))
22793 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
22803 __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
22823 __Pyx_TraceLine(1139,1,__PYX_ERR(1, 1139, __pyx_L1_error))
22839 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22842 __Pyx_TraceReturn(Py_None, 1);
22854 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
22855 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
22856 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
22857 Py_ssize_t __pyx_v_dst_extent;
22858 Py_ssize_t __pyx_v_src_stride;
22859 Py_ssize_t __pyx_v_dst_stride;
22863 Py_ssize_t __pyx_t_4;
22864 Py_ssize_t __pyx_t_5;
22865 Py_ssize_t __pyx_t_6;
22874 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
22883 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
22892 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
22901 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
22910 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
22920 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
22923 __pyx_t_1 = __pyx_t_2;
22924 goto __pyx_L5_bool_binop_done;
22926 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
22929 __pyx_t_1 = __pyx_t_2;
22930 goto __pyx_L5_bool_binop_done;
22940 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
22942 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
22944 __pyx_t_3 = (__pyx_t_2 != 0);
22945 __pyx_t_1 = __pyx_t_3;
22946 __pyx_L5_bool_binop_done:;
22964 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
22984 __pyx_t_4 = __pyx_v_dst_extent;
22985 __pyx_t_5 = __pyx_t_4;
22986 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
22987 __pyx_v_i = __pyx_t_6;
22996 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
23005 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
23014 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
23037 __pyx_t_4 = __pyx_v_dst_extent;
23038 __pyx_t_5 = __pyx_t_4;
23039 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23040 __pyx_v_i = __pyx_t_6;
23049 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
23058 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
23067 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
23091 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
23092 __Pyx_TraceDeclarations
23093 int __pyx_lineno = 0;
23094 const char *__pyx_filename = NULL;
23095 int __pyx_clineno = 0;
23096 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1172, 1, __PYX_ERR(1, 1172, __pyx_L1_error));
23105 __Pyx_TraceLine(1175,1,__PYX_ERR(1, 1175, __pyx_L1_error))
23106 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
23119 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23121 __Pyx_TraceReturn(Py_None, 1);
23132 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
23133 Py_ssize_t __pyx_v_shape;
23134 Py_ssize_t __pyx_v_size;
23135 Py_ssize_t __pyx_r;
23136 __Pyx_TraceDeclarations
23137 Py_ssize_t __pyx_t_1;
23138 Py_ssize_t *__pyx_t_2;
23139 Py_ssize_t *__pyx_t_3;
23140 Py_ssize_t *__pyx_t_4;
23141 int __pyx_lineno = 0;
23142 const char *__pyx_filename = NULL;
23143 int __pyx_clineno = 0;
23144 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1179, 1, __PYX_ERR(1, 1179, __pyx_L1_error));
23153 __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
23154 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
23155 __pyx_v_size = __pyx_t_1;
23164 __Pyx_TraceLine(1183,1,__PYX_ERR(1, 1183, __pyx_L1_error))
23165 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
23166 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
23167 __pyx_t_2 = __pyx_t_4;
23168 __pyx_v_shape = (__pyx_t_2[0]);
23177 __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
23178 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
23188 __Pyx_TraceLine(1186,1,__PYX_ERR(1, 1186, __pyx_L1_error))
23189 __pyx_r = __pyx_v_size;
23202 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23205 __Pyx_TraceReturn(Py_None, 1);
23217 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
23219 Py_ssize_t __pyx_r;
23220 __Pyx_TraceDeclarations
23225 int __pyx_lineno = 0;
23226 const char *__pyx_filename = NULL;
23227 int __pyx_clineno = 0;
23228 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1189, 1, __PYX_ERR(1, 1189, __pyx_L1_error));
23237 __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
23238 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
23248 __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
23249 __pyx_t_2 = __pyx_v_ndim;
23250 __pyx_t_3 = __pyx_t_2;
23251 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23252 __pyx_v_idx = __pyx_t_4;
23261 __Pyx_TraceLine(1200,1,__PYX_ERR(1, 1200, __pyx_L1_error))
23262 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
23271 __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
23272 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
23292 __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
23294 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
23295 __pyx_v_idx = __pyx_t_2;
23304 __Pyx_TraceLine(1204,1,__PYX_ERR(1, 1204, __pyx_L1_error))
23305 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
23314 __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
23315 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
23327 __Pyx_TraceLine(1207,1,__PYX_ERR(1, 1207, __pyx_L1_error))
23328 __pyx_r = __pyx_v_stride;
23341 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23344 __Pyx_TraceReturn(Py_None, 1);
23356 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
23358 void *__pyx_v_result;
23359 size_t __pyx_v_itemsize;
23360 size_t __pyx_v_size;
23362 __Pyx_TraceDeclarations
23363 Py_ssize_t __pyx_t_1;
23366 struct __pyx_memoryview_obj *__pyx_t_4;
23369 int __pyx_lineno = 0;
23370 const char *__pyx_filename = NULL;
23371 int __pyx_clineno = 0;
23372 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1210, 1, __PYX_ERR(1, 1210, __pyx_L1_error));
23381 __Pyx_TraceLine(1221,1,__PYX_ERR(1, 1221, __pyx_L1_error))
23382 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
23383 __pyx_v_itemsize = __pyx_t_1;
23392 __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
23393 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
23402 __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
23403 __pyx_v_result = malloc(__pyx_v_size);
23412 __Pyx_TraceLine(1225,1,__PYX_ERR(1, 1225, __pyx_L1_error))
23413 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
23423 __Pyx_TraceLine(1226,1,__PYX_ERR(1, 1226, __pyx_L1_error))
23424 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
23442 __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
23443 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
23452 __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
23453 __pyx_t_4 = __pyx_v_src->memview;
23454 __pyx_v_tmpslice->memview = __pyx_t_4;
23463 __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
23464 __pyx_t_3 = __pyx_v_ndim;
23465 __pyx_t_5 = __pyx_t_3;
23466 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23467 __pyx_v_i = __pyx_t_6;
23476 __Pyx_TraceLine(1232,1,__PYX_ERR(1, 1232, __pyx_L1_error))
23477 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
23486 __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
23487 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
23497 __Pyx_TraceLine(1235,1,__PYX_ERR(1, 1235, __pyx_L1_error))
23498 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
23507 __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
23508 __pyx_t_3 = __pyx_v_ndim;
23509 __pyx_t_5 = __pyx_t_3;
23510 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23511 __pyx_v_i = __pyx_t_6;
23520 __Pyx_TraceLine(1240,1,__PYX_ERR(1, 1240, __pyx_L1_error))
23521 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
23531 __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
23532 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
23551 __Pyx_TraceLine(1243,1,__PYX_ERR(1, 1243, __pyx_L1_error))
23552 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
23562 __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
23563 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
23582 __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
23584 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
23595 __Pyx_TraceLine(1248,1,__PYX_ERR(1, 1248, __pyx_L1_error))
23596 __pyx_r = __pyx_v_result;
23611 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23613 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
23615 __Pyx_PyGILState_Release(__pyx_gilstate_save);
23620 __Pyx_TraceReturn(Py_None, 1);
23632 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
23634 __Pyx_TraceDeclarations
23635 __Pyx_RefNannyDeclarations
23636 PyObject *__pyx_t_1 = NULL;
23637 PyObject *__pyx_t_2 = NULL;
23638 PyObject *__pyx_t_3 = NULL;
23639 PyObject *__pyx_t_4 = NULL;
23640 int __pyx_lineno = 0;
23641 const char *__pyx_filename = NULL;
23642 int __pyx_clineno = 0;
23644 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23646 __Pyx_RefNannySetupContext(
"_err_extents", 0);
23647 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1253, 0, __PYX_ERR(1, 1253, __pyx_L1_error));
23656 __Pyx_TraceLine(1256,0,__PYX_ERR(1, 1256, __pyx_L1_error))
23657 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
23658 __Pyx_GOTREF(__pyx_t_1);
23659 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
23660 __Pyx_GOTREF(__pyx_t_2);
23661 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
23662 __Pyx_GOTREF(__pyx_t_3);
23663 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
23664 __Pyx_GOTREF(__pyx_t_4);
23665 __Pyx_GIVEREF(__pyx_t_1);
23666 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
23667 __Pyx_GIVEREF(__pyx_t_2);
23668 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
23669 __Pyx_GIVEREF(__pyx_t_3);
23670 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
23682 __Pyx_TraceLine(1255,0,__PYX_ERR(1, 1255, __pyx_L1_error))
23683 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
23684 __Pyx_GOTREF(__pyx_t_3);
23685 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23686 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
23687 __Pyx_GOTREF(__pyx_t_4);
23688 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23689 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
23690 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23691 __PYX_ERR(1, 1255, __pyx_L1_error)
23703 __Pyx_XDECREF(__pyx_t_1);
23704 __Pyx_XDECREF(__pyx_t_2);
23705 __Pyx_XDECREF(__pyx_t_3);
23706 __Pyx_XDECREF(__pyx_t_4);
23707 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
23709 __Pyx_TraceReturn(Py_None, 0);
23710 __Pyx_RefNannyFinishContext();
23712 __Pyx_PyGILState_Release(__pyx_gilstate_save);
23725 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
23727 __Pyx_TraceDeclarations
23728 __Pyx_RefNannyDeclarations
23729 PyObject *__pyx_t_1 = NULL;
23730 PyObject *__pyx_t_2 = NULL;
23731 PyObject *__pyx_t_3 = NULL;
23732 PyObject *__pyx_t_4 = NULL;
23733 int __pyx_lineno = 0;
23734 const char *__pyx_filename = NULL;
23735 int __pyx_clineno = 0;
23737 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23739 __Pyx_RefNannySetupContext(
"_err_dim", 0);
23740 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1259, 0, __PYX_ERR(1, 1259, __pyx_L1_error));
23741 __Pyx_INCREF(__pyx_v_error);
23750 __Pyx_TraceLine(1260,0,__PYX_ERR(1, 1260, __pyx_L1_error))
23751 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
23752 __Pyx_GOTREF(__pyx_t_2);
23753 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
23754 __Pyx_GOTREF(__pyx_t_3);
23755 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
23756 __Pyx_GOTREF(__pyx_t_4);
23757 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23758 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23759 __Pyx_INCREF(__pyx_v_error);
23760 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
23761 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
23762 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
23763 if (likely(__pyx_t_2)) {
23764 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
23765 __Pyx_INCREF(__pyx_t_2);
23766 __Pyx_INCREF(
function);
23767 __Pyx_DECREF_SET(__pyx_t_3,
function);
23770 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
23771 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23772 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23773 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
23774 __Pyx_GOTREF(__pyx_t_1);
23775 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23776 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23778 __PYX_ERR(1, 1260, __pyx_L1_error)
23790 __Pyx_XDECREF(__pyx_t_1);
23791 __Pyx_XDECREF(__pyx_t_2);
23792 __Pyx_XDECREF(__pyx_t_3);
23793 __Pyx_XDECREF(__pyx_t_4);
23794 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
23796 __Pyx_XDECREF(__pyx_v_error);
23797 __Pyx_TraceReturn(Py_None, 0);
23798 __Pyx_RefNannyFinishContext();
23800 __Pyx_PyGILState_Release(__pyx_gilstate_save);
23813 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
23815 __Pyx_TraceDeclarations
23816 __Pyx_RefNannyDeclarations
23818 PyObject *__pyx_t_2 = NULL;
23819 PyObject *__pyx_t_3 = NULL;
23820 PyObject *__pyx_t_4 = NULL;
23821 PyObject *__pyx_t_5 = NULL;
23822 int __pyx_lineno = 0;
23823 const char *__pyx_filename = NULL;
23824 int __pyx_clineno = 0;
23826 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23828 __Pyx_RefNannySetupContext(
"_err", 0);
23829 __Pyx_TraceCall(
"_err", __pyx_f[1], 1263, 0, __PYX_ERR(1, 1263, __pyx_L1_error));
23830 __Pyx_INCREF(__pyx_v_error);
23839 __Pyx_TraceLine(1264,0,__PYX_ERR(1, 1264, __pyx_L1_error))
23840 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
23841 if (unlikely(__pyx_t_1)) {
23850 __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
23851 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
23852 __Pyx_GOTREF(__pyx_t_3);
23853 __Pyx_INCREF(__pyx_v_error);
23854 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
23855 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
23856 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
23857 if (likely(__pyx_t_5)) {
23858 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
23859 __Pyx_INCREF(__pyx_t_5);
23860 __Pyx_INCREF(
function);
23861 __Pyx_DECREF_SET(__pyx_t_4,
function);
23864 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
23865 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23866 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23867 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
23868 __Pyx_GOTREF(__pyx_t_2);
23869 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23870 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
23871 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23872 __PYX_ERR(1, 1265, __pyx_L1_error)
23890 __Pyx_TraceLine(1267,0,__PYX_ERR(1, 1267, __pyx_L1_error))
23892 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
23893 __PYX_ERR(1, 1267, __pyx_L1_error)
23906 __Pyx_XDECREF(__pyx_t_2);
23907 __Pyx_XDECREF(__pyx_t_3);
23908 __Pyx_XDECREF(__pyx_t_4);
23909 __Pyx_XDECREF(__pyx_t_5);
23910 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
23912 __Pyx_XDECREF(__pyx_v_error);
23913 __Pyx_TraceReturn(Py_None, 0);
23914 __Pyx_RefNannyFinishContext();
23916 __Pyx_PyGILState_Release(__pyx_gilstate_save);
23929 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
23930 void *__pyx_v_tmpdata;
23931 size_t __pyx_v_itemsize;
23933 char __pyx_v_order;
23934 int __pyx_v_broadcasting;
23935 int __pyx_v_direct_copy;
23936 __Pyx_memviewslice __pyx_v_tmp;
23939 __Pyx_TraceDeclarations
23940 Py_ssize_t __pyx_t_1;
23948 int __pyx_lineno = 0;
23949 const char *__pyx_filename = NULL;
23950 int __pyx_clineno = 0;
23951 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1270, 1, __PYX_ERR(1, 1270, __pyx_L1_error));
23960 __Pyx_TraceLine(1278,1,__PYX_ERR(1, 1278, __pyx_L1_error))
23961 __pyx_v_tmpdata = NULL;
23970 __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
23971 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
23972 __pyx_v_itemsize = __pyx_t_1;
23981 __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
23982 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
23991 __Pyx_TraceLine(1282,1,__PYX_ERR(1, 1282, __pyx_L1_error))
23992 __pyx_v_broadcasting = 0;
24001 __Pyx_TraceLine(1283,1,__PYX_ERR(1, 1283, __pyx_L1_error))
24002 __pyx_v_direct_copy = 0;
24011 __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
24012 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
24022 __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
24023 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
24042 __Pyx_TraceLine(1288,1,__PYX_ERR(1, 1288, __pyx_L1_error))
24043 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
24053 __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
24054 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
24073 __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
24074 __pyx_t_3 = __pyx_v_dst_ndim;
24075 __pyx_t_4 = __pyx_v_src_ndim;
24076 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
24077 __pyx_t_5 = __pyx_t_3;
24079 __pyx_t_5 = __pyx_t_4;
24081 __pyx_v_ndim = __pyx_t_5;
24090 __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
24091 __pyx_t_5 = __pyx_v_ndim;
24092 __pyx_t_3 = __pyx_t_5;
24093 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24094 __pyx_v_i = __pyx_t_4;
24103 __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
24104 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
24114 __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
24115 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
24125 __Pyx_TraceLine(1296,1,__PYX_ERR(1, 1296, __pyx_L1_error))
24126 __pyx_v_broadcasting = 1;
24135 __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
24136 (__pyx_v_src.strides[__pyx_v_i]) = 0;
24155 __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
24157 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
24177 __Pyx_TraceLine(1301,1,__PYX_ERR(1, 1301, __pyx_L1_error))
24178 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
24188 __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
24189 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
24208 __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
24209 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
24219 __Pyx_TraceLine(1306,1,__PYX_ERR(1, 1306, __pyx_L1_error))
24220 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
24230 __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
24231 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
24249 __Pyx_TraceLine(1309,1,__PYX_ERR(1, 1309, __pyx_L1_error))
24250 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
24251 __pyx_v_tmpdata = __pyx_t_7;
24260 __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
24261 __pyx_v_src = __pyx_v_tmp;
24279 __Pyx_TraceLine(1312,1,__PYX_ERR(1, 1312, __pyx_L1_error))
24280 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
24290 __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
24291 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
24301 __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
24302 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
24321 __Pyx_TraceLine(1317,1,__PYX_ERR(1, 1317, __pyx_L1_error))
24322 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
24332 __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
24333 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
24352 __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
24353 __pyx_t_2 = (__pyx_v_direct_copy != 0);
24363 __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
24364 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24373 __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
24374 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
24383 __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
24384 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24393 __Pyx_TraceLine(1325,1,__PYX_ERR(1, 1325, __pyx_L1_error))
24394 free(__pyx_v_tmpdata);
24403 __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
24432 __Pyx_TraceLine(1328,1,__PYX_ERR(1, 1328, __pyx_L1_error))
24433 __pyx_t_2 = (__pyx_v_order ==
'F');
24435 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
24437 __pyx_t_8 = (__pyx_t_2 != 0);
24447 __Pyx_TraceLine(1331,1,__PYX_ERR(1, 1331, __pyx_L1_error))
24448 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
24457 __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
24458 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
24476 __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
24477 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24486 __Pyx_TraceLine(1335,1,__PYX_ERR(1, 1335, __pyx_L1_error))
24487 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
24496 __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
24497 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24506 __Pyx_TraceLine(1338,1,__PYX_ERR(1, 1338, __pyx_L1_error))
24507 free(__pyx_v_tmpdata);
24516 __Pyx_TraceLine(1339,1,__PYX_ERR(1, 1339, __pyx_L1_error))
24532 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24534 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
24536 __Pyx_PyGILState_Release(__pyx_gilstate_save);
24541 __Pyx_TraceReturn(Py_None, 1);
24553 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
24555 int __pyx_v_offset;
24556 __Pyx_TraceDeclarations
24560 int __pyx_lineno = 0;
24561 const char *__pyx_filename = NULL;
24562 int __pyx_clineno = 0;
24563 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1342, 1, __PYX_ERR(1, 1342, __pyx_L1_error));
24572 __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
24573 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
24582 __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
24583 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
24584 __pyx_v_i = __pyx_t_1;
24593 __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
24594 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
24603 __Pyx_TraceLine(1350,1,__PYX_ERR(1, 1350, __pyx_L1_error))
24604 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
24613 __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
24614 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
24624 __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
24625 __pyx_t_1 = __pyx_v_offset;
24626 __pyx_t_2 = __pyx_t_1;
24627 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24628 __pyx_v_i = __pyx_t_3;
24637 __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
24638 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
24647 __Pyx_TraceLine(1355,1,__PYX_ERR(1, 1355, __pyx_L1_error))
24648 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
24657 __Pyx_TraceLine(1356,1,__PYX_ERR(1, 1356, __pyx_L1_error))
24658 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
24672 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24674 __Pyx_TraceReturn(Py_None, 1);
24685 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
24686 __Pyx_TraceDeclarations
24688 int __pyx_lineno = 0;
24689 const char *__pyx_filename = NULL;
24690 int __pyx_clineno = 0;
24691 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1364, 1, __PYX_ERR(1, 1364, __pyx_L1_error));
24700 __Pyx_TraceLine(1368,1,__PYX_ERR(1, 1368, __pyx_L1_error))
24701 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
24711 __Pyx_TraceLine(1369,1,__PYX_ERR(1, 1369, __pyx_L1_error))
24712 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
24734 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24736 __Pyx_TraceReturn(Py_None, 1);
24747 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
24748 __Pyx_TraceDeclarations
24749 __Pyx_RefNannyDeclarations
24750 int __pyx_lineno = 0;
24751 const char *__pyx_filename = NULL;
24752 int __pyx_clineno = 0;
24754 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24756 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
24757 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1373, 0, __PYX_ERR(1, 1373, __pyx_L1_error));
24766 __Pyx_TraceLine(1376,0,__PYX_ERR(1, 1376, __pyx_L1_error))
24767 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
24780 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
24782 __Pyx_TraceReturn(Py_None, 0);
24783 __Pyx_RefNannyFinishContext();
24785 __Pyx_PyGILState_Release(__pyx_gilstate_save);
24797 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
24798 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
24799 __Pyx_TraceDeclarations
24800 __Pyx_RefNannyDeclarations
24801 Py_ssize_t __pyx_t_1;
24802 Py_ssize_t __pyx_t_2;
24803 Py_ssize_t __pyx_t_3;
24805 int __pyx_lineno = 0;
24806 const char *__pyx_filename = NULL;
24807 int __pyx_clineno = 0;
24808 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
24809 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1379, 0, __PYX_ERR(1, 1379, __pyx_L1_error));
24818 __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
24819 __pyx_t_1 = (__pyx_v_shape[0]);
24820 __pyx_t_2 = __pyx_t_1;
24821 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24822 __pyx_v_i = __pyx_t_3;
24831 __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
24832 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
24842 __Pyx_TraceLine(1385,0,__PYX_ERR(1, 1385, __pyx_L1_error))
24843 __pyx_t_4 = (__pyx_v_inc != 0);
24853 __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
24854 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
24873 __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
24875 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
24896 __Pyx_TraceLine(1390,0,__PYX_ERR(1, 1390, __pyx_L1_error))
24906 __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
24907 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
24918 __Pyx_TraceLine(1393,0,__PYX_ERR(1, 1393, __pyx_L1_error))
24919 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
24933 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
24935 __Pyx_TraceReturn(Py_None, 0);
24936 __Pyx_RefNannyFinishContext();
24947 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
24948 __Pyx_TraceDeclarations
24949 int __pyx_lineno = 0;
24950 const char *__pyx_filename = NULL;
24951 int __pyx_clineno = 0;
24952 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1399, 1, __PYX_ERR(1, 1399, __pyx_L1_error));
24961 __Pyx_TraceLine(1402,1,__PYX_ERR(1, 1402, __pyx_L1_error))
24962 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24971 __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
24972 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
24981 __Pyx_TraceLine(1405,1,__PYX_ERR(1, 1405, __pyx_L1_error))
24982 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24995 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24997 __Pyx_TraceReturn(Py_None, 1);
25008 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
25009 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
25010 Py_ssize_t __pyx_v_stride;
25011 Py_ssize_t __pyx_v_extent;
25012 __Pyx_TraceDeclarations
25014 Py_ssize_t __pyx_t_2;
25015 Py_ssize_t __pyx_t_3;
25016 Py_ssize_t __pyx_t_4;
25017 int __pyx_lineno = 0;
25018 const char *__pyx_filename = NULL;
25019 int __pyx_clineno = 0;
25020 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1409, 1, __PYX_ERR(1, 1409, __pyx_L1_error));
25029 __Pyx_TraceLine(1413,1,__PYX_ERR(1, 1413, __pyx_L1_error))
25030 __pyx_v_stride = (__pyx_v_strides[0]);
25039 __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
25040 __pyx_v_extent = (__pyx_v_shape[0]);
25049 __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
25050 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
25060 __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
25061 __pyx_t_2 = __pyx_v_extent;
25062 __pyx_t_3 = __pyx_t_2;
25063 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
25064 __pyx_v_i = __pyx_t_4;
25073 __Pyx_TraceLine(1418,1,__PYX_ERR(1, 1418, __pyx_L1_error))
25074 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
25083 __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
25084 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
25104 __Pyx_TraceLine(1421,1,__PYX_ERR(1, 1421, __pyx_L1_error))
25106 __pyx_t_2 = __pyx_v_extent;
25107 __pyx_t_3 = __pyx_t_2;
25108 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
25109 __pyx_v_i = __pyx_t_4;
25118 __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
25119 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
25128 __Pyx_TraceLine(1424,1,__PYX_ERR(1, 1424, __pyx_L1_error))
25129 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
25145 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
25147 __Pyx_TraceReturn(Py_None, 1);
25157 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
25158 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
25159 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25160 PyObject *__pyx_v___pyx_type = 0;
25161 long __pyx_v___pyx_checksum;
25162 PyObject *__pyx_v___pyx_state = 0;
25163 int __pyx_lineno = 0;
25164 const char *__pyx_filename = NULL;
25165 int __pyx_clineno = 0;
25166 PyObject *__pyx_r = 0;
25167 __Pyx_RefNannyDeclarations
25168 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
25170 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
25171 PyObject* values[3] = {0,0,0};
25172 if (unlikely(__pyx_kwds)) {
25173 Py_ssize_t kw_args;
25174 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25175 switch (pos_args) {
25176 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
25177 CYTHON_FALLTHROUGH;
25178 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25179 CYTHON_FALLTHROUGH;
25180 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25181 CYTHON_FALLTHROUGH;
25183 default:
goto __pyx_L5_argtuple_error;
25185 kw_args = PyDict_Size(__pyx_kwds);
25186 switch (pos_args) {
25188 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
25189 else goto __pyx_L5_argtuple_error;
25190 CYTHON_FALLTHROUGH;
25192 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
25194 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
25196 CYTHON_FALLTHROUGH;
25198 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
25200 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
25203 if (unlikely(kw_args > 0)) {
25204 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
25206 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
25207 goto __pyx_L5_argtuple_error;
25209 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25210 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25211 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
25213 __pyx_v___pyx_type = values[0];
25214 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
25215 __pyx_v___pyx_state = values[2];
25217 goto __pyx_L4_argument_unpacking_done;
25218 __pyx_L5_argtuple_error:;
25219 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
25221 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
25222 __Pyx_RefNannyFinishContext();
25224 __pyx_L4_argument_unpacking_done:;
25225 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
25228 __Pyx_RefNannyFinishContext();
25232 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
25233 PyObject *__pyx_v___pyx_PickleError = 0;
25234 PyObject *__pyx_v___pyx_result = 0;
25235 PyObject *__pyx_r = NULL;
25236 __Pyx_TraceDeclarations
25237 __Pyx_RefNannyDeclarations
25238 PyObject *__pyx_t_1 = NULL;
25241 PyObject *__pyx_t_4 = NULL;
25242 PyObject *__pyx_t_5 = NULL;
25243 PyObject *__pyx_t_6 = NULL;
25244 int __pyx_lineno = 0;
25245 const char *__pyx_filename = NULL;
25246 int __pyx_clineno = 0;
25247 __Pyx_TraceFrameInit(__pyx_codeobj__40)
25248 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
25249 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
25258 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
25259 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
25260 __Pyx_GOTREF(__pyx_t_1);
25261 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__41, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
25262 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25263 __pyx_t_3 = (__pyx_t_2 != 0);
25273 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
25274 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
25275 __Pyx_GOTREF(__pyx_t_1);
25276 __Pyx_INCREF(__pyx_n_s_PickleError);
25277 __Pyx_GIVEREF(__pyx_n_s_PickleError);
25278 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
25279 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
25280 __Pyx_GOTREF(__pyx_t_4);
25281 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25282 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
25283 __Pyx_GOTREF(__pyx_t_1);
25284 __Pyx_INCREF(__pyx_t_1);
25285 __pyx_v___pyx_PickleError = __pyx_t_1;
25286 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25287 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25296 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
25297 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
25298 __Pyx_GOTREF(__pyx_t_1);
25299 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
25300 __Pyx_GOTREF(__pyx_t_5);
25301 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25302 __Pyx_INCREF(__pyx_v___pyx_PickleError);
25303 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
25304 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
25305 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
25306 if (likely(__pyx_t_6)) {
25307 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
25308 __Pyx_INCREF(__pyx_t_6);
25309 __Pyx_INCREF(
function);
25310 __Pyx_DECREF_SET(__pyx_t_1,
function);
25313 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
25314 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
25315 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25316 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
25317 __Pyx_GOTREF(__pyx_t_4);
25318 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25319 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
25320 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25321 __PYX_ERR(1, 6, __pyx_L1_error)
25339 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
25340 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
25341 __Pyx_GOTREF(__pyx_t_1);
25343 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
25344 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
25345 if (likely(__pyx_t_5)) {
25346 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
25347 __Pyx_INCREF(__pyx_t_5);
25348 __Pyx_INCREF(
function);
25349 __Pyx_DECREF_SET(__pyx_t_1,
function);
25352 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
25353 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25354 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
25355 __Pyx_GOTREF(__pyx_t_4);
25356 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25357 __pyx_v___pyx_result = __pyx_t_4;
25367 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
25368 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
25369 __pyx_t_2 = (__pyx_t_3 != 0);
25379 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
25380 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
25381 __pyx_t_4 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
25382 __Pyx_GOTREF(__pyx_t_4);
25383 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25401 __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
25402 __Pyx_XDECREF(__pyx_r);
25403 __Pyx_INCREF(__pyx_v___pyx_result);
25404 __pyx_r = __pyx_v___pyx_result;
25415 __Pyx_XDECREF(__pyx_t_1);
25416 __Pyx_XDECREF(__pyx_t_4);
25417 __Pyx_XDECREF(__pyx_t_5);
25418 __Pyx_XDECREF(__pyx_t_6);
25419 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
25422 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
25423 __Pyx_XDECREF(__pyx_v___pyx_result);
25424 __Pyx_XGIVEREF(__pyx_r);
25425 __Pyx_TraceReturn(__pyx_r, 0);
25426 __Pyx_RefNannyFinishContext();
25438 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
25439 PyObject *__pyx_r = NULL;
25440 __Pyx_TraceDeclarations
25441 __Pyx_RefNannyDeclarations
25442 PyObject *__pyx_t_1 = NULL;
25444 Py_ssize_t __pyx_t_3;
25447 PyObject *__pyx_t_6 = NULL;
25448 PyObject *__pyx_t_7 = NULL;
25449 PyObject *__pyx_t_8 = NULL;
25450 int __pyx_lineno = 0;
25451 const char *__pyx_filename = NULL;
25452 int __pyx_clineno = 0;
25453 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
25454 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
25463 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
25464 if (unlikely(__pyx_v___pyx_state == Py_None)) {
25465 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
25466 __PYX_ERR(1, 12, __pyx_L1_error)
25468 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
25469 __Pyx_GOTREF(__pyx_t_1);
25470 __Pyx_GIVEREF(__pyx_t_1);
25471 __Pyx_GOTREF(__pyx_v___pyx_result->name);
25472 __Pyx_DECREF(__pyx_v___pyx_result->name);
25473 __pyx_v___pyx_result->name = __pyx_t_1;
25482 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
25483 if (unlikely(__pyx_v___pyx_state == Py_None)) {
25484 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
25485 __PYX_ERR(1, 13, __pyx_L1_error)
25487 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
25488 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
25491 __pyx_t_2 = __pyx_t_4;
25492 goto __pyx_L4_bool_binop_done;
25494 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
25495 __pyx_t_5 = (__pyx_t_4 != 0);
25496 __pyx_t_2 = __pyx_t_5;
25497 __pyx_L4_bool_binop_done:;
25505 __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
25506 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
25507 __Pyx_GOTREF(__pyx_t_6);
25508 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
25509 __Pyx_GOTREF(__pyx_t_7);
25510 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25511 if (unlikely(__pyx_v___pyx_state == Py_None)) {
25512 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
25513 __PYX_ERR(1, 14, __pyx_L1_error)
25515 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
25516 __Pyx_GOTREF(__pyx_t_6);
25518 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
25519 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
25520 if (likely(__pyx_t_8)) {
25521 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
25522 __Pyx_INCREF(__pyx_t_8);
25523 __Pyx_INCREF(
function);
25524 __Pyx_DECREF_SET(__pyx_t_7,
function);
25527 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
25528 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
25529 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25530 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
25531 __Pyx_GOTREF(__pyx_t_1);
25532 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25533 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25552 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25555 __Pyx_XDECREF(__pyx_t_1);
25556 __Pyx_XDECREF(__pyx_t_6);
25557 __Pyx_XDECREF(__pyx_t_7);
25558 __Pyx_XDECREF(__pyx_t_8);
25559 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
25562 __Pyx_XGIVEREF(__pyx_r);
25563 __Pyx_TraceReturn(__pyx_r, 0);
25564 __Pyx_RefNannyFinishContext();
25567 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction __pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
25569 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyTypeObject *t, PyObject *a, PyObject *k) {
25570 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p;
25571 PyObject *o = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_new(t, a, k);
25572 if (unlikely(!o))
return 0;
25573 p = ((
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o);
25574 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
25575 p->A_csr = Py_None; Py_INCREF(Py_None);
25576 p->B_csr = Py_None; Py_INCREF(Py_None);
25577 p->A_indices_copy = Py_None; Py_INCREF(Py_None);
25578 p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25579 p->B_indices_copy = Py_None; Py_INCREF(Py_None);
25580 p->B_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25581 if (unlikely(__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(o, a, k) < 0))
goto bad;
25584 Py_DECREF(o); o = 0;
25588 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o) {
25589 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25590 #if CYTHON_USE_TP_FINALIZE
25591 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25592 if (PyObject_CallFinalizerFromDealloc(o))
return;
25595 PyObject_GC_UnTrack(o);
25596 Py_CLEAR(p->A_csr);
25597 Py_CLEAR(p->B_csr);
25598 Py_CLEAR(p->A_indices_copy);
25599 Py_CLEAR(p->A_index_pointer_copy);
25600 Py_CLEAR(p->B_indices_copy);
25601 Py_CLEAR(p->B_index_pointer_copy);
25602 PyObject_GC_Track(o);
25603 if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dealloc(o);
else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
25606 static int __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o, visitproc v,
void *a) {
25608 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25609 e = ((likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) ? ((__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse) ? __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction));
if (e)
return e;
25611 e = (*v)(p->A_csr, a);
if (e)
return e;
25614 e = (*v)(p->B_csr, a);
if (e)
return e;
25616 if (p->A_indices_copy) {
25617 e = (*v)(p->A_indices_copy, a);
if (e)
return e;
25619 if (p->A_index_pointer_copy) {
25620 e = (*v)(p->A_index_pointer_copy, a);
if (e)
return e;
25622 if (p->B_indices_copy) {
25623 e = (*v)(p->B_indices_copy, a);
if (e)
return e;
25625 if (p->B_index_pointer_copy) {
25626 e = (*v)(p->B_index_pointer_copy, a);
if (e)
return e;
25631 static int __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o) {
25633 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25634 if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) {
if (__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear(o); }
else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
25635 tmp = ((PyObject*)p->A_csr);
25636 p->A_csr = Py_None; Py_INCREF(Py_None);
25638 tmp = ((PyObject*)p->B_csr);
25639 p->B_csr = Py_None; Py_INCREF(Py_None);
25641 tmp = ((PyObject*)p->A_indices_copy);
25642 p->A_indices_copy = Py_None; Py_INCREF(Py_None);
25644 tmp = ((PyObject*)p->A_index_pointer_copy);
25645 p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25647 tmp = ((PyObject*)p->B_indices_copy);
25648 p->B_indices_copy = Py_None; Py_INCREF(Py_None);
25650 tmp = ((PyObject*)p->B_index_pointer_copy);
25651 p->B_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25656 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction[] = {
25657 {
"set_dense_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float},
25658 {
"set_dense_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double},
25659 {
"set_dense_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double},
25660 {
"set_csr_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float},
25661 {
"set_csr_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double},
25662 {
"set_csr_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double},
25663 {
"set_csc_matrix_float", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float},
25664 {
"set_csc_matrix_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double},
25665 {
"set_csc_matrix_long_double", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double},
25666 {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__},
25667 {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__},
25671 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = {
25672 PyVarObject_HEAD_INIT(0, 0)
25673 "imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction",
25674 sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction),
25676 __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction,
25677 #
if PY_VERSION_HEX < 0x030800b4
25680 #
if PY_VERSION_HEX >= 0x030800b4
25685 #
if PY_MAJOR_VERSION < 3
25688 #
if PY_MAJOR_VERSION >= 3
25701 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25702 "\n Defines a linear operator that is an affine function of a single parameter.\n Given two matrices :math:`\\mathbf{A}` and :math:`\\mathf{B}`, the linear\n operator is defined by\n\n .. math::\n\n \\mathbf{A}(t) = \\mathbf{A} + t \\mathbf{B},\n\n where :math:`t \\in \\mathbb{R}` is a parameter.\n\n **Initializing Object:**\n\n The matrices :math:`\\mathbf{A}` and :math:`\\mathbf{B}` are given at the\n initialization of the object. These matrices can be a dense matrix as 2D\n numpy arrays, or sparse matrices of any format (CSR, CSC, etc) using scipy\n sparse module.\n\n .. note::\n\n Initializing the linear operator requires python's GIL. Also, the\n following examples should be used in a ``*.pyx`` file and should be\n compiled as cython's extension module.\n\n In the following example, we create the object ``Aop`` based on\n scipy.sparse matrices of CSR format. Note the format of the input matrices\n can also be anything other than ``'csr'``, such as ``'csc'``.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import scipy.sparse\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = scipy.sparse.random(n, m, format='csr')\n >>> B = scipy.sparse.random(n, m, format='csr')\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport AffineMatrixFunction\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, B)\n\n\n The following is an example of defining the operator with dense matrices:\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import numpy\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = numpy.random.randn((n, m), dtype=float)\n >>> B = numpy.random.randn((n, m), dtype=float)\n\n >>> # Create linear operator object\n >>> from imate.linear_operator ""cimport AffineMatrixFunction\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, B)\n\n If the matrix ``B`` is not given, or if it is ``None``, or if it is ``0``,\n then the linear operator assumes ``B`` is zero matrix. For example:\n\n .. code-block:: python\n\n # Case 1: Not providing B\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A)\n\n # Case 2: Setting B to None\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, None)\n\n # Case 3: Setting B to scalar zero\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, 0)\n\n If the matrix ``B`` is set to the scalar ``1``, the linear operator assumes\n that ``B`` is the identity matrix. For example:\n\n .. code-block:: python\n\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, 1)\n\n **Setting the Parameter:**\n\n The parameter :math:`t` is given to the object ``Aop`` at **runtime** using\n :func:`set_parameters` function.\n\n .. note::\n\n Setting the parameter using :func:`set_parameter` does not require\n python's GIL, hence, the parameter can be set in ``nogil`` environment,\n if desired.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> cdef double t = 1.0\n\n >>> # nogil environment is optional\n >>> with nogil:\n ... Aop.set_parameters(&t)\n\n Note that a *pointer* to the parameter should be provided to the function.\n\n **Matrix-Vector Multiplications:**\n\n The linear operator can perform matrix vector multiplication using\n :func:`dot` function and the matrix-vector multiplication with the\n transposed matrix using :func:`transpose_dot` function.\n\n .. note::\n\n Matrix-vector multiplication using :func:`dot` and\n :func:`transpose_dot` functions do not require python's GIL, hence,\n they can be called in a ``nogil`` environment, if desired.\n""\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> # Create a vectors as cython's memoryview to numpy arrays\n >>> import numpy\n >>> cdef double[:] b = numpy.random.randn(m)\n >>> cdef double[:] c = numpy.empty((n, 1), dtype=float)\n\n >>> # Perform product on vector b and store the product on vector c\n >>> with nogil:\n ... Aop.dot(&b[0], &c[0])\n\n >>> # Perform product using the transpose of the operator\n >>> with nogil:\n >>> Aop.transpose_dot(&b[0], &c[0])\n\n .. seealso::\n\n :class:`Matrix`\n ",
25703 __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction,
25704 __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction,
25709 __pyx_methods_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction,
25719 __pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction,
25729 #
if PY_VERSION_HEX >= 0x030400a1
25732 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25735 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25738 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25742 static struct __pyx_vtabstruct_array __pyx_vtable_array;
25744 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25745 struct __pyx_array_obj *p;
25747 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25748 o = (*t->tp_alloc)(t, 0);
25750 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25752 if (unlikely(!o))
return 0;
25753 p = ((
struct __pyx_array_obj *)o);
25754 p->__pyx_vtab = __pyx_vtabptr_array;
25755 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25756 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25757 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
25760 Py_DECREF(o); o = 0;
25764 static void __pyx_tp_dealloc_array(PyObject *o) {
25765 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
25766 #if CYTHON_USE_TP_FINALIZE
25767 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25768 if (PyObject_CallFinalizerFromDealloc(o))
return;
25772 PyObject *etype, *eval, *etb;
25773 PyErr_Fetch(&etype, &eval, &etb);
25774 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25775 __pyx_array___dealloc__(o);
25776 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25777 PyErr_Restore(etype, eval, etb);
25780 Py_CLEAR(p->_format);
25781 (*Py_TYPE(o)->tp_free)(o);
25783 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25785 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
25786 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25791 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25793 return __pyx_array___setitem__(o, i, v);
25796 PyErr_Format(PyExc_NotImplementedError,
25797 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
25802 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25803 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
25804 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25806 v = __pyx_array___getattr__(o, n);
25811 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
25812 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25815 static PyMethodDef __pyx_methods_array[] = {
25816 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25817 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
25818 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
25822 static struct PyGetSetDef __pyx_getsets_array[] = {
25823 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
25827 static PySequenceMethods __pyx_tp_as_sequence_array = {
25828 __pyx_array___len__,
25831 __pyx_sq_item_array,
25840 static PyMappingMethods __pyx_tp_as_mapping_array = {
25841 __pyx_array___len__,
25842 __pyx_array___getitem__,
25843 __pyx_mp_ass_subscript_array,
25846 static PyBufferProcs __pyx_tp_as_buffer_array = {
25847 #if PY_MAJOR_VERSION < 3
25850 #if PY_MAJOR_VERSION < 3
25853 #if PY_MAJOR_VERSION < 3
25856 #if PY_MAJOR_VERSION < 3
25859 __pyx_array_getbuffer,
25863 static PyTypeObject __pyx_type___pyx_array = {
25864 PyVarObject_HEAD_INIT(0, 0)
25865 "imate._c_linear_operator.py_c_affine_matrix_function.array",
25866 sizeof(
struct __pyx_array_obj),
25868 __pyx_tp_dealloc_array,
25869 #
if PY_VERSION_HEX < 0x030800b4
25872 #
if PY_VERSION_HEX >= 0x030800b4
25877 #
if PY_MAJOR_VERSION < 3
25880 #
if PY_MAJOR_VERSION >= 3
25885 &__pyx_tp_as_sequence_array,
25886 &__pyx_tp_as_mapping_array,
25890 __pyx_tp_getattro_array,
25892 &__pyx_tp_as_buffer_array,
25893 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
25901 __pyx_methods_array,
25903 __pyx_getsets_array,
25911 __pyx_tp_new_array,
25921 #
if PY_VERSION_HEX >= 0x030400a1
25924 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25927 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25930 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25935 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
25936 struct __pyx_MemviewEnum_obj *p;
25938 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25939 o = (*t->tp_alloc)(t, 0);
25941 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25943 if (unlikely(!o))
return 0;
25944 p = ((
struct __pyx_MemviewEnum_obj *)o);
25945 p->name = Py_None; Py_INCREF(Py_None);
25949 static void __pyx_tp_dealloc_Enum(PyObject *o) {
25950 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
25951 #if CYTHON_USE_TP_FINALIZE
25952 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25953 if (PyObject_CallFinalizerFromDealloc(o))
return;
25956 PyObject_GC_UnTrack(o);
25958 (*Py_TYPE(o)->tp_free)(o);
25961 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v,
void *a) {
25963 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
25965 e = (*v)(p->name, a);
if (e)
return e;
25970 static int __pyx_tp_clear_Enum(PyObject *o) {
25972 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
25973 tmp = ((PyObject*)p->name);
25974 p->name = Py_None; Py_INCREF(Py_None);
25979 static PyMethodDef __pyx_methods_Enum[] = {
25980 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
25981 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
25985 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
25986 PyVarObject_HEAD_INIT(0, 0)
25987 "imate._c_linear_operator.py_c_affine_matrix_function.Enum",
25988 sizeof(
struct __pyx_MemviewEnum_obj),
25990 __pyx_tp_dealloc_Enum,
25991 #
if PY_VERSION_HEX < 0x030800b4
25994 #
if PY_VERSION_HEX >= 0x030800b4
25999 #
if PY_MAJOR_VERSION < 3
26002 #
if PY_MAJOR_VERSION >= 3
26005 __pyx_MemviewEnum___repr__,
26015 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26017 __pyx_tp_traverse_Enum,
26018 __pyx_tp_clear_Enum,
26023 __pyx_methods_Enum,
26031 __pyx_MemviewEnum___init__,
26043 #
if PY_VERSION_HEX >= 0x030400a1
26046 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26049 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26052 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26056 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
26058 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
26059 struct __pyx_memoryview_obj *p;
26061 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
26062 o = (*t->tp_alloc)(t, 0);
26064 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
26066 if (unlikely(!o))
return 0;
26067 p = ((
struct __pyx_memoryview_obj *)o);
26068 p->__pyx_vtab = __pyx_vtabptr_memoryview;
26069 p->obj = Py_None; Py_INCREF(Py_None);
26070 p->_size = Py_None; Py_INCREF(Py_None);
26071 p->_array_interface = Py_None; Py_INCREF(Py_None);
26072 p->view.obj = NULL;
26073 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
26076 Py_DECREF(o); o = 0;
26080 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
26081 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
26082 #if CYTHON_USE_TP_FINALIZE
26083 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26084 if (PyObject_CallFinalizerFromDealloc(o))
return;
26087 PyObject_GC_UnTrack(o);
26089 PyObject *etype, *eval, *etb;
26090 PyErr_Fetch(&etype, &eval, &etb);
26091 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26092 __pyx_memoryview___dealloc__(o);
26093 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26094 PyErr_Restore(etype, eval, etb);
26097 Py_CLEAR(p->_size);
26098 Py_CLEAR(p->_array_interface);
26099 (*Py_TYPE(o)->tp_free)(o);
26102 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v,
void *a) {
26104 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
26106 e = (*v)(p->obj, a);
if (e)
return e;
26109 e = (*v)(p->_size, a);
if (e)
return e;
26111 if (p->_array_interface) {
26112 e = (*v)(p->_array_interface, a);
if (e)
return e;
26115 e = (*v)(p->view.obj, a);
if (e)
return e;
26120 static int __pyx_tp_clear_memoryview(PyObject *o) {
26122 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
26123 tmp = ((PyObject*)p->obj);
26124 p->obj = Py_None; Py_INCREF(Py_None);
26126 tmp = ((PyObject*)p->_size);
26127 p->_size = Py_None; Py_INCREF(Py_None);
26129 tmp = ((PyObject*)p->_array_interface);
26130 p->_array_interface = Py_None; Py_INCREF(Py_None);
26132 Py_CLEAR(p->view.obj);
26135 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
26137 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
26138 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
26143 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
26145 return __pyx_memoryview___setitem__(o, i, v);
26148 PyErr_Format(PyExc_NotImplementedError,
26149 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
26154 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
26155 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
26158 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
26159 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
26162 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
26163 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
26166 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
26167 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
26170 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
26171 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
26174 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
26175 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
26178 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
26179 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
26182 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
26183 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
26186 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
26187 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
26190 static PyMethodDef __pyx_methods_memoryview[] = {
26191 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
26192 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
26193 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
26194 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
26195 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
26196 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
26200 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
26201 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
26202 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
26203 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
26204 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
26205 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
26206 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
26207 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
26208 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
26209 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
26213 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
26214 __pyx_memoryview___len__,
26217 __pyx_sq_item_memoryview,
26226 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
26227 __pyx_memoryview___len__,
26228 __pyx_memoryview___getitem__,
26229 __pyx_mp_ass_subscript_memoryview,
26232 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26233 #if PY_MAJOR_VERSION < 3
26236 #if PY_MAJOR_VERSION < 3
26239 #if PY_MAJOR_VERSION < 3
26242 #if PY_MAJOR_VERSION < 3
26245 __pyx_memoryview_getbuffer,
26249 static PyTypeObject __pyx_type___pyx_memoryview = {
26250 PyVarObject_HEAD_INIT(0, 0)
26251 "imate._c_linear_operator.py_c_affine_matrix_function.memoryview",
26252 sizeof(
struct __pyx_memoryview_obj),
26254 __pyx_tp_dealloc_memoryview,
26255 #
if PY_VERSION_HEX < 0x030800b4
26258 #
if PY_VERSION_HEX >= 0x030800b4
26263 #
if PY_MAJOR_VERSION < 3
26266 #
if PY_MAJOR_VERSION >= 3
26269 __pyx_memoryview___repr__,
26271 &__pyx_tp_as_sequence_memoryview,
26272 &__pyx_tp_as_mapping_memoryview,
26275 __pyx_memoryview___str__,
26278 &__pyx_tp_as_buffer_memoryview,
26279 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26281 __pyx_tp_traverse_memoryview,
26282 __pyx_tp_clear_memoryview,
26287 __pyx_methods_memoryview,
26289 __pyx_getsets_memoryview,
26297 __pyx_tp_new_memoryview,
26307 #
if PY_VERSION_HEX >= 0x030400a1
26310 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26313 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26316 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26320 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
26322 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
26323 struct __pyx_memoryviewslice_obj *p;
26324 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
26325 if (unlikely(!o))
return 0;
26326 p = ((
struct __pyx_memoryviewslice_obj *)o);
26327 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
26328 p->from_object = Py_None; Py_INCREF(Py_None);
26329 p->from_slice.memview = NULL;
26333 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
26334 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
26335 #if CYTHON_USE_TP_FINALIZE
26336 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26337 if (PyObject_CallFinalizerFromDealloc(o))
return;
26340 PyObject_GC_UnTrack(o);
26342 PyObject *etype, *eval, *etb;
26343 PyErr_Fetch(&etype, &eval, &etb);
26344 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26345 __pyx_memoryviewslice___dealloc__(o);
26346 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26347 PyErr_Restore(etype, eval, etb);
26349 Py_CLEAR(p->from_object);
26350 PyObject_GC_Track(o);
26351 __pyx_tp_dealloc_memoryview(o);
26354 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v,
void *a) {
26356 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
26357 e = __pyx_tp_traverse_memoryview(o, v, a);
if (e)
return e;
26358 if (p->from_object) {
26359 e = (*v)(p->from_object, a);
if (e)
return e;
26364 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26366 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
26367 __pyx_tp_clear_memoryview(o);
26368 tmp = ((PyObject*)p->from_object);
26369 p->from_object = Py_None; Py_INCREF(Py_None);
26371 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
26375 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
26376 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
26379 static PyMethodDef __pyx_methods__memoryviewslice[] = {
26380 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
26381 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
26385 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
26386 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
26390 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26391 PyVarObject_HEAD_INIT(0, 0)
26392 "imate._c_linear_operator.py_c_affine_matrix_function._memoryviewslice",
26393 sizeof(
struct __pyx_memoryviewslice_obj),
26395 __pyx_tp_dealloc__memoryviewslice,
26396 #
if PY_VERSION_HEX < 0x030800b4
26399 #
if PY_VERSION_HEX >= 0x030800b4
26404 #
if PY_MAJOR_VERSION < 3
26407 #
if PY_MAJOR_VERSION >= 3
26410 #
if CYTHON_COMPILING_IN_PYPY
26411 __pyx_memoryview___repr__,
26420 #
if CYTHON_COMPILING_IN_PYPY
26421 __pyx_memoryview___str__,
26428 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26429 "Internal class for passing memoryview slices to Python",
26430 __pyx_tp_traverse__memoryviewslice,
26431 __pyx_tp_clear__memoryviewslice,
26436 __pyx_methods__memoryviewslice,
26438 __pyx_getsets__memoryviewslice,
26446 __pyx_tp_new__memoryviewslice,
26456 #
if PY_VERSION_HEX >= 0x030400a1
26459 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26462 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26465 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26470 static PyMethodDef __pyx_methods[] = {
26474 #if PY_MAJOR_VERSION >= 3
26475 #if CYTHON_PEP489_MULTI_PHASE_INIT
26476 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
26477 static int __pyx_pymod_exec_py_c_affine_matrix_function(PyObject* module);
26478 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
26479 {Py_mod_create, (
void*)__pyx_pymod_create},
26480 {Py_mod_exec, (
void*)__pyx_pymod_exec_py_c_affine_matrix_function},
26485 static struct PyModuleDef __pyx_moduledef = {
26486 PyModuleDef_HEAD_INIT,
26487 "py_c_affine_matrix_function",
26489 #if CYTHON_PEP489_MULTI_PHASE_INIT
26495 #if CYTHON_PEP489_MULTI_PHASE_INIT
26496 __pyx_moduledef_slots,
26505 #ifndef CYTHON_SMALL_CODE
26506 #if defined(__clang__)
26507 #define CYTHON_SMALL_CODE
26508 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
26509 #define CYTHON_SMALL_CODE __attribute__((cold))
26511 #define CYTHON_SMALL_CODE
26515 static __Pyx_StringTabEntry __pyx_string_tab[] = {
26516 {&__pyx_n_s_A, __pyx_k_A,
sizeof(__pyx_k_A), 0, 0, 1, 1},
26517 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
26518 {&__pyx_kp_u_A_and_B_should_have_similar_data, __pyx_k_A_and_B_should_have_similar_data,
sizeof(__pyx_k_A_and_B_should_have_similar_data), 0, 1, 0, 0},
26519 {&__pyx_kp_u_A_and_B_should_have_the_same_sha, __pyx_k_A_and_B_should_have_the_same_sha,
sizeof(__pyx_k_A_and_B_should_have_the_same_sha), 0, 1, 0, 0},
26520 {&__pyx_kp_u_A_cannot_be_None, __pyx_k_A_cannot_be_None,
sizeof(__pyx_k_A_cannot_be_None), 0, 1, 0, 0},
26521 {&__pyx_n_s_A_data, __pyx_k_A_data,
sizeof(__pyx_k_A_data), 0, 0, 1, 1},
26522 {&__pyx_n_s_A_data_mv, __pyx_k_A_data_mv,
sizeof(__pyx_k_A_data_mv), 0, 0, 1, 1},
26523 {&__pyx_n_s_A_data_mv_c, __pyx_k_A_data_mv_c,
sizeof(__pyx_k_A_data_mv_c), 0, 0, 1, 1},
26524 {&__pyx_n_s_A_data_mv_f, __pyx_k_A_data_mv_f,
sizeof(__pyx_k_A_data_mv_f), 0, 0, 1, 1},
26525 {&__pyx_n_s_A_index_pointer, __pyx_k_A_index_pointer,
sizeof(__pyx_k_A_index_pointer), 0, 0, 1, 1},
26526 {&__pyx_n_s_A_index_pointer_mv, __pyx_k_A_index_pointer_mv,
sizeof(__pyx_k_A_index_pointer_mv), 0, 0, 1, 1},
26527 {&__pyx_n_s_A_indices, __pyx_k_A_indices,
sizeof(__pyx_k_A_indices), 0, 0, 1, 1},
26528 {&__pyx_n_s_A_indices_mv, __pyx_k_A_indices_mv,
sizeof(__pyx_k_A_indices_mv), 0, 0, 1, 1},
26529 {&__pyx_n_s_A_is_row_major, __pyx_k_A_is_row_major,
sizeof(__pyx_k_A_is_row_major), 0, 0, 1, 1},
26530 {&__pyx_n_s_A_num_columns, __pyx_k_A_num_columns,
sizeof(__pyx_k_A_num_columns), 0, 0, 1, 1},
26531 {&__pyx_n_s_A_num_rows, __pyx_k_A_num_rows,
sizeof(__pyx_k_A_num_rows), 0, 0, 1, 1},
26532 {&__pyx_n_s_B, __pyx_k_B,
sizeof(__pyx_k_B), 0, 0, 1, 1},
26533 {&__pyx_n_s_B_data, __pyx_k_B_data,
sizeof(__pyx_k_B_data), 0, 0, 1, 1},
26534 {&__pyx_n_s_B_data_mv, __pyx_k_B_data_mv,
sizeof(__pyx_k_B_data_mv), 0, 0, 1, 1},
26535 {&__pyx_n_s_B_data_mv_c, __pyx_k_B_data_mv_c,
sizeof(__pyx_k_B_data_mv_c), 0, 0, 1, 1},
26536 {&__pyx_n_s_B_data_mv_f, __pyx_k_B_data_mv_f,
sizeof(__pyx_k_B_data_mv_f), 0, 0, 1, 1},
26537 {&__pyx_n_s_B_index_pointer, __pyx_k_B_index_pointer,
sizeof(__pyx_k_B_index_pointer), 0, 0, 1, 1},
26538 {&__pyx_n_s_B_index_pointer_mv, __pyx_k_B_index_pointer_mv,
sizeof(__pyx_k_B_index_pointer_mv), 0, 0, 1, 1},
26539 {&__pyx_n_s_B_indices, __pyx_k_B_indices,
sizeof(__pyx_k_B_indices), 0, 0, 1, 1},
26540 {&__pyx_n_s_B_indices_mv, __pyx_k_B_indices_mv,
sizeof(__pyx_k_B_indices_mv), 0, 0, 1, 1},
26541 {&__pyx_n_s_B_is_identity, __pyx_k_B_is_identity,
sizeof(__pyx_k_B_is_identity), 0, 0, 1, 1},
26542 {&__pyx_n_s_B_is_row_major, __pyx_k_B_is_row_major,
sizeof(__pyx_k_B_is_row_major), 0, 0, 1, 1},
26543 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
26544 {&__pyx_n_u_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS,
sizeof(__pyx_k_C_CONTIGUOUS), 0, 1, 0, 1},
26545 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
26546 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
26547 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
26548 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
26549 {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa,
sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
26550 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
26551 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
26552 {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS,
sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1},
26553 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0,
sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
26554 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
26555 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
26556 {&__pyx_kp_u_Input_matrix_should_be_a_2_dimen, __pyx_k_Input_matrix_should_be_a_2_dimen,
sizeof(__pyx_k_Input_matrix_should_be_a_2_dimen), 0, 1, 0, 0},
26557 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
26558 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
26559 {&__pyx_kp_u_Matrices_A_and_B_should_have_sim, __pyx_k_Matrices_A_and_B_should_have_sim,
sizeof(__pyx_k_Matrices_A_and_B_should_have_sim), 0, 1, 0, 0},
26560 {&__pyx_kp_u_Matrix_A_should_be_either_C_or_F, __pyx_k_Matrix_A_should_be_either_C_or_F,
sizeof(__pyx_k_Matrix_A_should_be_either_C_or_F), 0, 1, 0, 0},
26561 {&__pyx_kp_u_Matrix_B_should_be_either_C_or_F, __pyx_k_Matrix_B_should_be_either_C_or_F,
sizeof(__pyx_k_Matrix_B_should_be_either_C_or_F), 0, 1, 0, 0},
26562 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
26563 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
26564 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
26565 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
26566 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
26567 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
26568 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
26569 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
26570 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
26571 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
26572 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
26573 {&__pyx_n_s_astype, __pyx_k_astype,
sizeof(__pyx_k_astype), 0, 0, 1, 1},
26574 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
26575 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
26576 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
26577 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
26578 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
26579 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
26580 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
26581 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
26582 {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix,
sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
26583 {&__pyx_n_s_data, __pyx_k_data,
sizeof(__pyx_k_data), 0, 0, 1, 1},
26584 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
26585 {&__pyx_n_s_dtype, __pyx_k_dtype,
sizeof(__pyx_k_dtype), 0, 0, 1, 1},
26586 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
26587 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
26588 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
26589 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
26590 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
26591 {&__pyx_n_b_float128, __pyx_k_float128,
sizeof(__pyx_k_float128), 0, 0, 0, 1},
26592 {&__pyx_n_b_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 0, 0, 1},
26593 {&__pyx_n_b_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 0, 0, 1},
26594 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
26595 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
26596 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
26597 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
26598 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
26599 {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices,
sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
26600 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
26601 {&__pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_k_imate__c_linear_operator_py_c_af,
sizeof(__pyx_k_imate__c_linear_operator_py_c_af), 0, 0, 1, 0},
26602 {&__pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_k_imate__c_linear_operator_py_c_af_2,
sizeof(__pyx_k_imate__c_linear_operator_py_c_af_2), 0, 0, 1, 1},
26603 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
26604 {&__pyx_n_s_indices, __pyx_k_indices,
sizeof(__pyx_k_indices), 0, 0, 1, 1},
26605 {&__pyx_n_s_indptr, __pyx_k_indptr,
sizeof(__pyx_k_indptr), 0, 0, 1, 1},
26606 {&__pyx_n_s_issparse, __pyx_k_issparse,
sizeof(__pyx_k_issparse), 0, 0, 1, 1},
26607 {&__pyx_n_s_isspmatrix_csc, __pyx_k_isspmatrix_csc,
sizeof(__pyx_k_isspmatrix_csc), 0, 0, 1, 1},
26608 {&__pyx_n_s_isspmatrix_csr, __pyx_k_isspmatrix_csr,
sizeof(__pyx_k_isspmatrix_csr), 0, 0, 1, 1},
26609 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
26610 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
26611 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
26612 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
26613 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
26614 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
26615 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
26616 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
26617 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
26618 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
26619 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
26620 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
26621 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
26622 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
26623 {&__pyx_n_s_pycAffineMatrixFunction, __pyx_k_pycAffineMatrixFunction,
sizeof(__pyx_k_pycAffineMatrixFunction), 0, 0, 1, 1},
26624 {&__pyx_n_s_pycAffineMatrixFunction___reduce, __pyx_k_pycAffineMatrixFunction___reduce,
sizeof(__pyx_k_pycAffineMatrixFunction___reduce), 0, 0, 1, 1},
26625 {&__pyx_n_s_pycAffineMatrixFunction___setsta, __pyx_k_pycAffineMatrixFunction___setsta,
sizeof(__pyx_k_pycAffineMatrixFunction___setsta), 0, 0, 1, 1},
26626 {&__pyx_n_s_pycAffineMatrixFunction_set_csc, __pyx_k_pycAffineMatrixFunction_set_csc,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csc), 0, 0, 1, 1},
26627 {&__pyx_n_s_pycAffineMatrixFunction_set_csc_2, __pyx_k_pycAffineMatrixFunction_set_csc_2,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csc_2), 0, 0, 1, 1},
26628 {&__pyx_n_s_pycAffineMatrixFunction_set_csc_3, __pyx_k_pycAffineMatrixFunction_set_csc_3,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csc_3), 0, 0, 1, 1},
26629 {&__pyx_n_s_pycAffineMatrixFunction_set_csr, __pyx_k_pycAffineMatrixFunction_set_csr,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csr), 0, 0, 1, 1},
26630 {&__pyx_n_s_pycAffineMatrixFunction_set_csr_2, __pyx_k_pycAffineMatrixFunction_set_csr_2,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csr_2), 0, 0, 1, 1},
26631 {&__pyx_n_s_pycAffineMatrixFunction_set_csr_3, __pyx_k_pycAffineMatrixFunction_set_csr_3,
sizeof(__pyx_k_pycAffineMatrixFunction_set_csr_3), 0, 0, 1, 1},
26632 {&__pyx_n_s_pycAffineMatrixFunction_set_dens, __pyx_k_pycAffineMatrixFunction_set_dens,
sizeof(__pyx_k_pycAffineMatrixFunction_set_dens), 0, 0, 1, 1},
26633 {&__pyx_n_s_pycAffineMatrixFunction_set_dens_2, __pyx_k_pycAffineMatrixFunction_set_dens_2,
sizeof(__pyx_k_pycAffineMatrixFunction_set_dens_2), 0, 0, 1, 1},
26634 {&__pyx_n_s_pycAffineMatrixFunction_set_dens_3, __pyx_k_pycAffineMatrixFunction_set_dens_3,
sizeof(__pyx_k_pycAffineMatrixFunction_set_dens_3), 0, 0, 1, 1},
26635 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
26636 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
26637 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
26638 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
26639 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
26640 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
26641 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
26642 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
26643 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
26644 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
26645 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
26646 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
26647 {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse,
sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
26648 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
26649 {&__pyx_n_s_set_csc_matrix_double, __pyx_k_set_csc_matrix_double,
sizeof(__pyx_k_set_csc_matrix_double), 0, 0, 1, 1},
26650 {&__pyx_n_s_set_csc_matrix_float, __pyx_k_set_csc_matrix_float,
sizeof(__pyx_k_set_csc_matrix_float), 0, 0, 1, 1},
26651 {&__pyx_n_s_set_csc_matrix_long_double, __pyx_k_set_csc_matrix_long_double,
sizeof(__pyx_k_set_csc_matrix_long_double), 0, 0, 1, 1},
26652 {&__pyx_n_s_set_csr_matrix_double, __pyx_k_set_csr_matrix_double,
sizeof(__pyx_k_set_csr_matrix_double), 0, 0, 1, 1},
26653 {&__pyx_n_s_set_csr_matrix_float, __pyx_k_set_csr_matrix_float,
sizeof(__pyx_k_set_csr_matrix_float), 0, 0, 1, 1},
26654 {&__pyx_n_s_set_csr_matrix_long_double, __pyx_k_set_csr_matrix_long_double,
sizeof(__pyx_k_set_csr_matrix_long_double), 0, 0, 1, 1},
26655 {&__pyx_n_s_set_dense_matrix_double, __pyx_k_set_dense_matrix_double,
sizeof(__pyx_k_set_dense_matrix_double), 0, 0, 1, 1},
26656 {&__pyx_n_s_set_dense_matrix_float, __pyx_k_set_dense_matrix_float,
sizeof(__pyx_k_set_dense_matrix_float), 0, 0, 1, 1},
26657 {&__pyx_n_s_set_dense_matrix_long_double, __pyx_k_set_dense_matrix_long_double,
sizeof(__pyx_k_set_dense_matrix_long_double), 0, 0, 1, 1},
26658 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
26659 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
26660 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
26661 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
26662 {&__pyx_n_s_sort_indices, __pyx_k_sort_indices,
sizeof(__pyx_k_sort_indices), 0, 0, 1, 1},
26663 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
26664 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
26665 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
26666 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
26667 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
26668 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
26669 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
26670 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
26671 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
26672 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
26673 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
26674 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
26675 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
26676 {0, 0, 0, 0, 0, 0, 0}
26678 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
26679 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 179, __pyx_L1_error)
26680 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 192, __pyx_L1_error)
26681 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
26682 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
26683 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 181, __pyx_L1_error)
26684 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
26685 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
26686 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
26692 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
26693 __Pyx_RefNannyDeclarations
26694 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
26703 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_A_cannot_be_None);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 179, __pyx_L1_error)
26704 __Pyx_GOTREF(__pyx_tuple_);
26705 __Pyx_GIVEREF(__pyx_tuple_);
26714 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Input_matrix_should_be_a_2_dimen);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 182, __pyx_L1_error)
26715 __Pyx_GOTREF(__pyx_tuple__2);
26716 __Pyx_GIVEREF(__pyx_tuple__2);
26725 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 192, __pyx_L1_error)
26726 __Pyx_GOTREF(__pyx_tuple__3);
26727 __Pyx_GIVEREF(__pyx_tuple__3);
26736 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Matrices_A_and_B_should_have_sim);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 208, __pyx_L1_error)
26737 __Pyx_GOTREF(__pyx_tuple__4);
26738 __Pyx_GIVEREF(__pyx_tuple__4);
26747 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_A_and_B_should_have_similar_data);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 212, __pyx_L1_error)
26748 __Pyx_GOTREF(__pyx_tuple__5);
26749 __Pyx_GIVEREF(__pyx_tuple__5);
26758 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_A_and_B_should_have_the_same_sha);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 216, __pyx_L1_error)
26759 __Pyx_GOTREF(__pyx_tuple__6);
26760 __Pyx_GIVEREF(__pyx_tuple__6);
26769 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Matrix_A_should_be_either_C_or_F);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 327, __pyx_L1_error)
26770 __Pyx_GOTREF(__pyx_tuple__8);
26771 __Pyx_GIVEREF(__pyx_tuple__8);
26780 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Matrix_B_should_be_either_C_or_F);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 335, __pyx_L1_error)
26781 __Pyx_GOTREF(__pyx_tuple__9);
26782 __Pyx_GIVEREF(__pyx_tuple__9);
26790 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
26791 __Pyx_GOTREF(__pyx_tuple__19);
26792 __Pyx_GIVEREF(__pyx_tuple__19);
26799 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
26800 __Pyx_GOTREF(__pyx_tuple__21);
26801 __Pyx_GIVEREF(__pyx_tuple__21);
26810 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 134, __pyx_L1_error)
26811 __Pyx_GOTREF(__pyx_tuple__22);
26812 __Pyx_GIVEREF(__pyx_tuple__22);
26821 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 137, __pyx_L1_error)
26822 __Pyx_GOTREF(__pyx_tuple__23);
26823 __Pyx_GIVEREF(__pyx_tuple__23);
26832 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 149, __pyx_L1_error)
26833 __Pyx_GOTREF(__pyx_tuple__24);
26834 __Pyx_GIVEREF(__pyx_tuple__24);
26843 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 177, __pyx_L1_error)
26844 __Pyx_GOTREF(__pyx_tuple__25);
26845 __Pyx_GIVEREF(__pyx_tuple__25);
26854 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 193, __pyx_L1_error)
26855 __Pyx_GOTREF(__pyx_tuple__26);
26856 __Pyx_GIVEREF(__pyx_tuple__26);
26864 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
26865 __Pyx_GOTREF(__pyx_tuple__27);
26866 __Pyx_GIVEREF(__pyx_tuple__27);
26873 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
26874 __Pyx_GOTREF(__pyx_tuple__28);
26875 __Pyx_GIVEREF(__pyx_tuple__28);
26884 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 420, __pyx_L1_error)
26885 __Pyx_GOTREF(__pyx_tuple__29);
26886 __Pyx_GIVEREF(__pyx_tuple__29);
26895 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 497, __pyx_L1_error)
26896 __Pyx_GOTREF(__pyx_tuple__30);
26897 __Pyx_GIVEREF(__pyx_tuple__30);
26906 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 522, __pyx_L1_error)
26907 __Pyx_GOTREF(__pyx_tuple__31);
26908 __Pyx_GIVEREF(__pyx_tuple__31);
26917 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 572, __pyx_L1_error)
26918 __Pyx_GOTREF(__pyx_tuple__32);
26919 __Pyx_GIVEREF(__pyx_tuple__32);
26928 __pyx_tuple__33 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 579, __pyx_L1_error)
26929 __Pyx_GOTREF(__pyx_tuple__33);
26930 __Pyx_INCREF(__pyx_int_neg_1);
26931 __Pyx_GIVEREF(__pyx_int_neg_1);
26932 PyTuple_SET_ITEM(__pyx_tuple__33, 0, __pyx_int_neg_1);
26933 __Pyx_GIVEREF(__pyx_tuple__33);
26941 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
26942 __Pyx_GOTREF(__pyx_tuple__34);
26943 __Pyx_GIVEREF(__pyx_tuple__34);
26950 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
26951 __Pyx_GOTREF(__pyx_tuple__35);
26952 __Pyx_GIVEREF(__pyx_tuple__35);
26961 __pyx_slice__36 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__36)) __PYX_ERR(1, 684, __pyx_L1_error)
26962 __Pyx_GOTREF(__pyx_slice__36);
26963 __Pyx_GIVEREF(__pyx_slice__36);
26972 __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 705, __pyx_L1_error)
26973 __Pyx_GOTREF(__pyx_tuple__37);
26974 __Pyx_GIVEREF(__pyx_tuple__37);
26982 __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 2, __pyx_L1_error)
26983 __Pyx_GOTREF(__pyx_tuple__38);
26984 __Pyx_GIVEREF(__pyx_tuple__38);
26991 __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 4, __pyx_L1_error)
26992 __Pyx_GOTREF(__pyx_tuple__39);
26993 __Pyx_GIVEREF(__pyx_tuple__39);
26994 __pyx_tuple__41 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 4, __pyx_L1_error)
26995 __Pyx_GOTREF(__pyx_tuple__41);
26996 __Pyx_GIVEREF(__pyx_tuple__41);
27005 __pyx_tuple__42 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 306, __pyx_L1_error)
27006 __Pyx_GOTREF(__pyx_tuple__42);
27007 __Pyx_GIVEREF(__pyx_tuple__42);
27008 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_float, 306, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 306, __pyx_L1_error)
27017 __pyx_tuple__43 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 402, __pyx_L1_error)
27018 __Pyx_GOTREF(__pyx_tuple__43);
27019 __Pyx_GIVEREF(__pyx_tuple__43);
27020 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_double, 402, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 402, __pyx_L1_error)
27029 __pyx_tuple__44 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 498, __pyx_L1_error)
27030 __Pyx_GOTREF(__pyx_tuple__44);
27031 __Pyx_GIVEREF(__pyx_tuple__44);
27032 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_long_double, 498, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 498, __pyx_L1_error)
27041 __pyx_tuple__45 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 594, __pyx_L1_error)
27042 __Pyx_GOTREF(__pyx_tuple__45);
27043 __Pyx_GIVEREF(__pyx_tuple__45);
27044 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_float, 594, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 594, __pyx_L1_error)
27053 __pyx_tuple__46 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 665, __pyx_L1_error)
27054 __Pyx_GOTREF(__pyx_tuple__46);
27055 __Pyx_GIVEREF(__pyx_tuple__46);
27056 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_double, 665, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 665, __pyx_L1_error)
27065 __pyx_tuple__47 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 736, __pyx_L1_error)
27066 __Pyx_GOTREF(__pyx_tuple__47);
27067 __Pyx_GIVEREF(__pyx_tuple__47);
27068 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_long_double, 736, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 736, __pyx_L1_error)
27077 __pyx_tuple__48 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 807, __pyx_L1_error)
27078 __Pyx_GOTREF(__pyx_tuple__48);
27079 __Pyx_GIVEREF(__pyx_tuple__48);
27080 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_float, 807, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 807, __pyx_L1_error)
27089 __pyx_tuple__49 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 878, __pyx_L1_error)
27090 __Pyx_GOTREF(__pyx_tuple__49);
27091 __Pyx_GIVEREF(__pyx_tuple__49);
27092 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_double, 878, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 878, __pyx_L1_error)
27101 __pyx_tuple__50 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 949, __pyx_L1_error)
27102 __Pyx_GOTREF(__pyx_tuple__50);
27103 __Pyx_GIVEREF(__pyx_tuple__50);
27104 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_long_double, 949, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 949, __pyx_L1_error)
27111 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 1, __pyx_L1_error)
27112 __Pyx_GOTREF(__pyx_tuple__51);
27113 __Pyx_GIVEREF(__pyx_tuple__51);
27114 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 1, __pyx_L1_error)
27122 __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 3, __pyx_L1_error)
27123 __Pyx_GOTREF(__pyx_tuple__52);
27124 __Pyx_GIVEREF(__pyx_tuple__52);
27125 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 3, __pyx_L1_error)
27134 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 287, __pyx_L1_error)
27135 __Pyx_GOTREF(__pyx_tuple__53);
27136 __Pyx_GIVEREF(__pyx_tuple__53);
27145 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 288, __pyx_L1_error)
27146 __Pyx_GOTREF(__pyx_tuple__54);
27147 __Pyx_GIVEREF(__pyx_tuple__54);
27156 __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 289, __pyx_L1_error)
27157 __Pyx_GOTREF(__pyx_tuple__55);
27158 __Pyx_GIVEREF(__pyx_tuple__55);
27167 __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 292, __pyx_L1_error)
27168 __Pyx_GOTREF(__pyx_tuple__56);
27169 __Pyx_GIVEREF(__pyx_tuple__56);
27178 __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 293, __pyx_L1_error)
27179 __Pyx_GOTREF(__pyx_tuple__57);
27180 __Pyx_GIVEREF(__pyx_tuple__57);
27187 __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 1, __pyx_L1_error)
27188 __Pyx_GOTREF(__pyx_tuple__58);
27189 __Pyx_GIVEREF(__pyx_tuple__58);
27190 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 1, __pyx_L1_error)
27191 __Pyx_RefNannyFinishContext();
27194 __Pyx_RefNannyFinishContext();
27198 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
27200 __Pyx_init_assertions_enabled();
27202 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27204 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27205 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
27206 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27207 __pyx_int_2 = PyInt_FromLong(2);
if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
27208 __pyx_int_112105877 = PyInt_FromLong(112105877L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
27209 __pyx_int_136983863 = PyInt_FromLong(136983863L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
27210 __pyx_int_184977713 = PyInt_FromLong(184977713L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
27211 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27217 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
27218 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
27219 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
27220 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
27221 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
27222 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
27223 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
27225 static int __Pyx_modinit_global_init_code(
void) {
27226 __Pyx_RefNannyDeclarations
27227 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
27229 generic = Py_None; Py_INCREF(Py_None);
27230 strided = Py_None; Py_INCREF(Py_None);
27231 indirect = Py_None; Py_INCREF(Py_None);
27232 contiguous = Py_None; Py_INCREF(Py_None);
27233 indirect_contiguous = Py_None; Py_INCREF(Py_None);
27234 __Pyx_RefNannyFinishContext();
27238 static int __Pyx_modinit_variable_export_code(
void) {
27239 __Pyx_RefNannyDeclarations
27240 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
27242 __Pyx_RefNannyFinishContext();
27246 static int __Pyx_modinit_function_export_code(
void) {
27247 __Pyx_RefNannyDeclarations
27248 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
27250 __Pyx_RefNannyFinishContext();
27254 static int __Pyx_modinit_type_init_code(
void) {
27255 __Pyx_RefNannyDeclarations
27256 PyObject *__pyx_t_1 = NULL;
27257 int __pyx_lineno = 0;
27258 const char *__pyx_filename = NULL;
27259 int __pyx_clineno = 0;
27260 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
27262 __pyx_t_1 = PyImport_ImportModule(
"imate._c_linear_operator.py_c_linear_operator");
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27263 __Pyx_GOTREF(__pyx_t_1);
27264 __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType_0_29_36(__pyx_t_1,
"imate._c_linear_operator.py_c_linear_operator",
"pycLinearOperator",
sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator),__Pyx_ImportType_CheckSize_Warn_0_29_36);
if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(0, 1, __pyx_L1_error)
27265 __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (
struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict);
if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(0, 1, __pyx_L1_error)
27266 __pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = &__pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
27267 __pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.__pyx_base = *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
27268 __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_base = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
27269 if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27270 #if PY_VERSION_HEX < 0x030800B1
27271 __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_print = 0;
27273 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_getattro == PyObject_GenericGetAttr)) {
27274 __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27276 if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27277 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycAffineMatrixFunction, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27278 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27279 __pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = &__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
27280 __pyx_vtabptr_array = &__pyx_vtable_array;
27281 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
27282 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
27283 #if PY_VERSION_HEX < 0x030800B1
27284 __pyx_type___pyx_array.tp_print = 0;
27286 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
27287 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
27288 __pyx_array_type = &__pyx_type___pyx_array;
27289 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
27290 #if PY_VERSION_HEX < 0x030800B1
27291 __pyx_type___pyx_MemviewEnum.tp_print = 0;
27293 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
27294 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27296 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
27297 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
27298 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
27299 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
27300 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
27301 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
27302 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
27303 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
27304 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
27305 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
27306 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
27307 #if PY_VERSION_HEX < 0x030800B1
27308 __pyx_type___pyx_memoryview.tp_print = 0;
27310 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
27311 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27313 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
27314 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
27315 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
27316 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
27317 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
27318 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
27319 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
27320 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
27321 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
27322 #if PY_VERSION_HEX < 0x030800B1
27323 __pyx_type___pyx_memoryviewslice.tp_print = 0;
27325 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
27326 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27328 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
27329 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
27330 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
27331 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27332 __Pyx_RefNannyFinishContext();
27335 __Pyx_XDECREF(__pyx_t_1);
27336 __Pyx_RefNannyFinishContext();
27340 static int __Pyx_modinit_type_import_code(
void) {
27341 __Pyx_RefNannyDeclarations
27342 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
27344 __Pyx_RefNannyFinishContext();
27348 static int __Pyx_modinit_variable_import_code(
void) {
27349 __Pyx_RefNannyDeclarations
27350 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
27352 __Pyx_RefNannyFinishContext();
27356 static int __Pyx_modinit_function_import_code(
void) {
27357 __Pyx_RefNannyDeclarations
27358 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
27360 __Pyx_RefNannyFinishContext();
27365 #ifndef CYTHON_NO_PYINIT_EXPORT
27366 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27367 #elif PY_MAJOR_VERSION < 3
27369 #define __Pyx_PyMODINIT_FUNC extern "C" void
27371 #define __Pyx_PyMODINIT_FUNC void
27375 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27377 #define __Pyx_PyMODINIT_FUNC PyObject *
27382 #if PY_MAJOR_VERSION < 3
27383 __Pyx_PyMODINIT_FUNC initpy_c_affine_matrix_function(
void) CYTHON_SMALL_CODE;
27384 __Pyx_PyMODINIT_FUNC initpy_c_affine_matrix_function(
void)
27386 __Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(
void) CYTHON_SMALL_CODE;
27387 __Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(
void)
27388 #if CYTHON_PEP489_MULTI_PHASE_INIT
27390 return PyModuleDef_Init(&__pyx_moduledef);
27392 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
27393 #if PY_VERSION_HEX >= 0x030700A1
27394 static PY_INT64_T main_interpreter_id = -1;
27395 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
27396 if (main_interpreter_id == -1) {
27397 main_interpreter_id = current_id;
27398 return (unlikely(current_id == -1)) ? -1 : 0;
27399 }
else if (unlikely(main_interpreter_id != current_id))
27401 static PyInterpreterState *main_interpreter = NULL;
27402 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
27403 if (!main_interpreter) {
27404 main_interpreter = current_interpreter;
27405 }
else if (unlikely(main_interpreter != current_interpreter))
27410 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
27415 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
27416 PyObject *value = PyObject_GetAttrString(spec, from_name);
27418 if (likely(value)) {
27419 if (allow_none || value != Py_None) {
27420 result = PyDict_SetItemString(moddict, to_name, value);
27423 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27430 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
27431 PyObject *module = NULL, *moddict, *modname;
27432 if (__Pyx_check_single_interpreter())
27435 return __Pyx_NewRef(__pyx_m);
27436 modname = PyObject_GetAttrString(spec,
"name");
27437 if (unlikely(!modname))
goto bad;
27438 module = PyModule_NewObject(modname);
27439 Py_DECREF(modname);
27440 if (unlikely(!module))
goto bad;
27441 moddict = PyModule_GetDict(module);
27442 if (unlikely(!moddict))
goto bad;
27443 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
27444 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
27445 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
27446 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
27449 Py_XDECREF(module);
27454 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_py_c_affine_matrix_function(PyObject *__pyx_pyinit_module)
27458 __Pyx_TraceDeclarations
27459 PyObject *__pyx_t_1 = NULL;
27460 PyObject *__pyx_t_2 = NULL;
27461 static PyThread_type_lock __pyx_t_3[8];
27462 int __pyx_lineno = 0;
27463 const char *__pyx_filename = NULL;
27464 int __pyx_clineno = 0;
27465 __Pyx_RefNannyDeclarations
27466 #if CYTHON_PEP489_MULTI_PHASE_INIT
27468 if (__pyx_m == __pyx_pyinit_module)
return 0;
27469 PyErr_SetString(PyExc_RuntimeError,
"Module 'py_c_affine_matrix_function' has already been imported. Re-initialisation is not supported.");
27472 #elif PY_MAJOR_VERSION >= 3
27473 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
27475 #if CYTHON_REFNANNY
27476 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
27477 if (!__Pyx_RefNanny) {
27479 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
27480 if (!__Pyx_RefNanny)
27481 Py_FatalError(
"failed to import 'refnanny' module");
27484 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void)", 0);
27485 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27486 #ifdef __Pxy_PyFrame_Initialize_Offsets
27487 __Pxy_PyFrame_Initialize_Offsets();
27489 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27490 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27491 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27492 #ifdef __Pyx_CyFunction_USED
27493 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27495 #ifdef __Pyx_FusedFunction_USED
27496 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27498 #ifdef __Pyx_Coroutine_USED
27499 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27501 #ifdef __Pyx_Generator_USED
27502 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27504 #ifdef __Pyx_AsyncGen_USED
27505 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27507 #ifdef __Pyx_StopAsyncIteration_USED
27508 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27512 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
27513 PyEval_InitThreads();
27516 #if CYTHON_PEP489_MULTI_PHASE_INIT
27517 __pyx_m = __pyx_pyinit_module;
27518 Py_INCREF(__pyx_m);
27520 #if PY_MAJOR_VERSION < 3
27521 __pyx_m = Py_InitModule4(
"py_c_affine_matrix_function", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
27523 __pyx_m = PyModule_Create(&__pyx_moduledef);
27525 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27527 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27528 Py_INCREF(__pyx_d);
27529 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27530 Py_INCREF(__pyx_b);
27531 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27532 Py_INCREF(__pyx_cython_runtime);
27533 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27535 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27536 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
27537 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27539 if (__pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function) {
27540 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27542 #if PY_MAJOR_VERSION >= 3
27544 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27545 if (!PyDict_GetItemString(modules,
"imate._c_linear_operator.py_c_affine_matrix_function")) {
27546 if (unlikely(PyDict_SetItemString(modules,
"imate._c_linear_operator.py_c_affine_matrix_function", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
27551 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27553 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27555 (void)__Pyx_modinit_global_init_code();
27556 (void)__Pyx_modinit_variable_export_code();
27557 (void)__Pyx_modinit_function_export_code();
27558 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
27559 (void)__Pyx_modinit_type_import_code();
27560 (void)__Pyx_modinit_variable_import_code();
27561 (void)__Pyx_modinit_function_import_code();
27563 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
27564 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27566 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
27575 __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
27576 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
27577 __Pyx_GOTREF(__pyx_t_1);
27578 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
27579 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27588 __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
27589 __pyx_t_1 = PyList_New(4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27590 __Pyx_GOTREF(__pyx_t_1);
27591 __Pyx_INCREF(__pyx_n_s_issparse);
27592 __Pyx_GIVEREF(__pyx_n_s_issparse);
27593 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_issparse);
27594 __Pyx_INCREF(__pyx_n_s_isspmatrix_csr);
27595 __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csr);
27596 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_isspmatrix_csr);
27597 __Pyx_INCREF(__pyx_n_s_isspmatrix_csc);
27598 __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csc);
27599 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isspmatrix_csc);
27600 __Pyx_INCREF(__pyx_n_s_csr_matrix);
27601 __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
27602 PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_csr_matrix);
27603 __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
27604 __Pyx_GOTREF(__pyx_t_2);
27605 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27606 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27607 __Pyx_GOTREF(__pyx_t_1);
27608 if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27609 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27610 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27611 __Pyx_GOTREF(__pyx_t_1);
27612 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csr, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27613 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27614 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27615 __Pyx_GOTREF(__pyx_t_1);
27616 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csc, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27617 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27618 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27619 __Pyx_GOTREF(__pyx_t_1);
27620 if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27621 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27622 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27631 __Pyx_TraceLine(306,0,__PYX_ERR(0, 306, __pyx_L1_error))
27632 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__7));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
27633 __Pyx_GOTREF(__pyx_t_2);
27634 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
27635 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27636 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27645 __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
27646 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
27647 __Pyx_GOTREF(__pyx_t_2);
27648 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
27649 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27650 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27659 __Pyx_TraceLine(498,0,__PYX_ERR(0, 498, __pyx_L1_error))
27660 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__11));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
27661 __Pyx_GOTREF(__pyx_t_2);
27662 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 498, __pyx_L1_error)
27663 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27664 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27673 __Pyx_TraceLine(594,0,__PYX_ERR(0, 594, __pyx_L1_error))
27674 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__12));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
27675 __Pyx_GOTREF(__pyx_t_2);
27676 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 594, __pyx_L1_error)
27677 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27678 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27687 __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error))
27688 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__13));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
27689 __Pyx_GOTREF(__pyx_t_2);
27690 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
27691 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27692 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27701 __Pyx_TraceLine(736,0,__PYX_ERR(0, 736, __pyx_L1_error))
27702 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
27703 __Pyx_GOTREF(__pyx_t_2);
27704 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
27705 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27706 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27715 __Pyx_TraceLine(807,0,__PYX_ERR(0, 807, __pyx_L1_error))
27716 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__15));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
27717 __Pyx_GOTREF(__pyx_t_2);
27718 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 807, __pyx_L1_error)
27719 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27720 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27729 __Pyx_TraceLine(878,0,__PYX_ERR(0, 878, __pyx_L1_error))
27730 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__16));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error)
27731 __Pyx_GOTREF(__pyx_t_2);
27732 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 878, __pyx_L1_error)
27733 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27734 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27743 __Pyx_TraceLine(949,0,__PYX_ERR(0, 949, __pyx_L1_error))
27744 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__17));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error)
27745 __Pyx_GOTREF(__pyx_t_2);
27746 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 949, __pyx_L1_error)
27747 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27748 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27755 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
27756 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction___reduce, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__18));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
27757 __Pyx_GOTREF(__pyx_t_2);
27758 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
27759 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27767 __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
27768 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction___setsta, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__20));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
27769 __Pyx_GOTREF(__pyx_t_2);
27770 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
27771 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27778 __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
27779 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
27780 __Pyx_GOTREF(__pyx_t_2);
27781 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27782 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27791 __Pyx_TraceLine(210,0,__PYX_ERR(1, 210, __pyx_L1_error))
27792 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __pyx_L1_error)
27793 __Pyx_GOTREF(__pyx_t_2);
27794 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
27795 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27796 PyType_Modified(__pyx_array_type);
27805 __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
27815 __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error))
27825 __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
27826 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
27827 __Pyx_GOTREF(__pyx_t_2);
27828 __Pyx_XGOTREF(
generic);
27829 __Pyx_DECREF_SET(
generic, __pyx_t_2);
27830 __Pyx_GIVEREF(__pyx_t_2);
27840 __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
27841 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
27842 __Pyx_GOTREF(__pyx_t_2);
27843 __Pyx_XGOTREF(strided);
27844 __Pyx_DECREF_SET(strided, __pyx_t_2);
27845 __Pyx_GIVEREF(__pyx_t_2);
27855 __Pyx_TraceLine(289,0,__PYX_ERR(1, 289, __pyx_L1_error))
27856 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
27857 __Pyx_GOTREF(__pyx_t_2);
27858 __Pyx_XGOTREF(indirect);
27859 __Pyx_DECREF_SET(indirect, __pyx_t_2);
27860 __Pyx_GIVEREF(__pyx_t_2);
27870 __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
27871 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
27872 __Pyx_GOTREF(__pyx_t_2);
27873 __Pyx_XGOTREF(contiguous);
27874 __Pyx_DECREF_SET(contiguous, __pyx_t_2);
27875 __Pyx_GIVEREF(__pyx_t_2);
27885 __Pyx_TraceLine(293,0,__PYX_ERR(1, 293, __pyx_L1_error))
27886 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error)
27887 __Pyx_GOTREF(__pyx_t_2);
27888 __Pyx_XGOTREF(indirect_contiguous);
27889 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
27890 __Pyx_GIVEREF(__pyx_t_2);
27900 __Pyx_TraceLine(299,0,__PYX_ERR(1, 299, __pyx_L1_error))
27910 __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
27911 __pyx_memoryview_thread_locks_used = 0;
27920 __Pyx_TraceLine(318,0,__PYX_ERR(1, 318, __pyx_L1_error))
27921 __pyx_t_3[0] = PyThread_allocate_lock();
27922 __pyx_t_3[1] = PyThread_allocate_lock();
27923 __pyx_t_3[2] = PyThread_allocate_lock();
27924 __pyx_t_3[3] = PyThread_allocate_lock();
27925 __pyx_t_3[4] = PyThread_allocate_lock();
27926 __pyx_t_3[5] = PyThread_allocate_lock();
27927 __pyx_t_3[6] = PyThread_allocate_lock();
27928 __pyx_t_3[7] = PyThread_allocate_lock();
27929 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27938 __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
27948 __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
27958 __Pyx_TraceLine(443,0,__PYX_ERR(1, 443, __pyx_L1_error))
27968 __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
27978 __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
27988 __Pyx_TraceLine(487,0,__PYX_ERR(1, 487, __pyx_L1_error))
27998 __Pyx_TraceLine(503,0,__PYX_ERR(1, 503, __pyx_L1_error))
28008 __Pyx_TraceLine(551,0,__PYX_ERR(1, 551, __pyx_L1_error))
28009 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
28010 __Pyx_GOTREF(__pyx_t_2);
28011 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
28012 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28013 PyType_Modified(__pyx_memoryview_type);
28022 __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
28032 __Pyx_TraceLine(665,0,__PYX_ERR(1, 665, __pyx_L1_error))
28042 __Pyx_TraceLine(668,0,__PYX_ERR(1, 668, __pyx_L1_error))
28052 __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
28062 __Pyx_TraceLine(712,0,__PYX_ERR(1, 712, __pyx_L1_error))
28072 __Pyx_TraceLine(809,0,__PYX_ERR(1, 809, __pyx_L1_error))
28082 __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
28092 __Pyx_TraceLine(945,0,__PYX_ERR(1, 945, __pyx_L1_error))
28102 __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
28112 __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
28122 __Pyx_TraceLine(997,0,__PYX_ERR(1, 997, __pyx_L1_error))
28123 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
28124 __Pyx_GOTREF(__pyx_t_2);
28125 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
28126 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28127 PyType_Modified(__pyx_memoryviewslice_type);
28136 __Pyx_TraceLine(1001,0,__PYX_ERR(1, 1001, __pyx_L1_error))
28146 __Pyx_TraceLine(1054,0,__PYX_ERR(1, 1054, __pyx_L1_error))
28156 __Pyx_TraceLine(1065,0,__PYX_ERR(1, 1065, __pyx_L1_error))
28166 __Pyx_TraceLine(1082,0,__PYX_ERR(1, 1082, __pyx_L1_error))
28176 __Pyx_TraceLine(1089,0,__PYX_ERR(1, 1089, __pyx_L1_error))
28186 __Pyx_TraceLine(1111,0,__PYX_ERR(1, 1111, __pyx_L1_error))
28196 __Pyx_TraceLine(1118,0,__PYX_ERR(1, 1118, __pyx_L1_error))
28206 __Pyx_TraceLine(1172,0,__PYX_ERR(1, 1172, __pyx_L1_error))
28216 __Pyx_TraceLine(1179,0,__PYX_ERR(1, 1179, __pyx_L1_error))
28226 __Pyx_TraceLine(1189,0,__PYX_ERR(1, 1189, __pyx_L1_error))
28236 __Pyx_TraceLine(1210,0,__PYX_ERR(1, 1210, __pyx_L1_error))
28246 __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
28256 __Pyx_TraceLine(1259,0,__PYX_ERR(1, 1259, __pyx_L1_error))
28266 __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
28276 __Pyx_TraceLine(1270,0,__PYX_ERR(1, 1270, __pyx_L1_error))
28286 __Pyx_TraceLine(1342,0,__PYX_ERR(1, 1342, __pyx_L1_error))
28296 __Pyx_TraceLine(1364,0,__PYX_ERR(1, 1364, __pyx_L1_error))
28306 __Pyx_TraceLine(1373,0,__PYX_ERR(1, 1373, __pyx_L1_error))
28316 __Pyx_TraceLine(1379,0,__PYX_ERR(1, 1379, __pyx_L1_error))
28326 __Pyx_TraceLine(1399,0,__PYX_ERR(1, 1399, __pyx_L1_error))
28336 __Pyx_TraceLine(1409,0,__PYX_ERR(1, 1409, __pyx_L1_error))
28344 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
28345 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
28346 __Pyx_GOTREF(__pyx_t_2);
28347 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
28348 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28357 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
28359 __Pyx_TraceReturn(Py_None, 0);
28365 __Pyx_XDECREF(__pyx_t_1);
28366 __Pyx_XDECREF(__pyx_t_2);
28369 __Pyx_AddTraceback(
"init imate._c_linear_operator.py_c_affine_matrix_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
28372 }
else if (!PyErr_Occurred()) {
28373 PyErr_SetString(PyExc_ImportError,
"init imate._c_linear_operator.py_c_affine_matrix_function");
28376 __Pyx_RefNannyFinishContext();
28377 #if CYTHON_PEP489_MULTI_PHASE_INIT
28378 return (__pyx_m != NULL) ? 0 : -1;
28379 #elif PY_MAJOR_VERSION >= 3
28388 #if CYTHON_REFNANNY
28389 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
28390 PyObject *m = NULL, *p = NULL;
28392 m = PyImport_ImportModule(modname);
28394 p = PyObject_GetAttrString(m,
"RefNannyAPI");
28396 r = PyLong_AsVoidPtr(p);
28400 return (__Pyx_RefNannyAPIStruct *)r;
28405 #if CYTHON_USE_TYPE_SLOTS
28406 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28407 PyTypeObject* tp = Py_TYPE(obj);
28408 if (likely(tp->tp_getattro))
28409 return tp->tp_getattro(obj, attr_name);
28410 #if PY_MAJOR_VERSION < 3
28411 if (likely(tp->tp_getattr))
28412 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
28414 return PyObject_GetAttr(obj, attr_name);
28419 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28420 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
28421 if (unlikely(!result)) {
28422 PyErr_Format(PyExc_NameError,
28423 #
if PY_MAJOR_VERSION >= 3
28424 "name '%U' is not defined", name);
28426 "name '%.200s' is not defined", PyString_AS_STRING(name));
28433 static void __Pyx_RaiseDoubleKeywordsError(
28434 const char* func_name,
28437 PyErr_Format(PyExc_TypeError,
28438 #
if PY_MAJOR_VERSION >= 3
28439 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
28441 "%s() got multiple values for keyword argument '%s'", func_name,
28442 PyString_AsString(kw_name));
28447 static int __Pyx_ParseOptionalKeywords(
28449 PyObject **argnames[],
28451 PyObject *values[],
28452 Py_ssize_t num_pos_args,
28453 const char* function_name)
28455 PyObject *key = 0, *value = 0;
28456 Py_ssize_t pos = 0;
28458 PyObject*** first_kw_arg = argnames + num_pos_args;
28459 while (PyDict_Next(kwds, &pos, &key, &value)) {
28460 name = first_kw_arg;
28461 while (*name && (**name != key)) name++;
28463 values[name-argnames] = value;
28466 name = first_kw_arg;
28467 #if PY_MAJOR_VERSION < 3
28468 if (likely(PyString_Check(key))) {
28470 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
28471 && _PyString_Eq(**name, key)) {
28472 values[name-argnames] = value;
28477 if (*name)
continue;
28479 PyObject*** argname = argnames;
28480 while (argname != first_kw_arg) {
28481 if ((**argname == key) || (
28482 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
28483 && _PyString_Eq(**argname, key))) {
28484 goto arg_passed_twice;
28491 if (likely(PyUnicode_Check(key))) {
28493 int cmp = (**name == key) ? 0 :
28494 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28495 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28497 PyUnicode_Compare(**name, key);
28498 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
28500 values[name-argnames] = value;
28505 if (*name)
continue;
28507 PyObject*** argname = argnames;
28508 while (argname != first_kw_arg) {
28509 int cmp = (**argname == key) ? 0 :
28510 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28511 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28513 PyUnicode_Compare(**argname, key);
28514 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
28515 if (cmp == 0)
goto arg_passed_twice;
28520 goto invalid_keyword_type;
28522 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
28524 goto invalid_keyword;
28529 __Pyx_RaiseDoubleKeywordsError(function_name, key);
28531 invalid_keyword_type:
28532 PyErr_Format(PyExc_TypeError,
28533 "%.200s() keywords must be strings", function_name);
28536 PyErr_Format(PyExc_TypeError,
28537 #
if PY_MAJOR_VERSION < 3
28538 "%.200s() got an unexpected keyword argument '%.200s'",
28539 function_name, PyString_AsString(key));
28541 "%s() got an unexpected keyword argument '%U'",
28542 function_name, key);
28549 static void __Pyx_RaiseArgtupleInvalid(
28550 const char* func_name,
28552 Py_ssize_t num_min,
28553 Py_ssize_t num_max,
28554 Py_ssize_t num_found)
28556 Py_ssize_t num_expected;
28557 const char *more_or_less;
28558 if (num_found < num_min) {
28559 num_expected = num_min;
28560 more_or_less =
"at least";
28562 num_expected = num_max;
28563 more_or_less =
"at most";
28566 more_or_less =
"exactly";
28568 PyErr_Format(PyExc_TypeError,
28569 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
28570 func_name, more_or_less, num_expected,
28571 (num_expected == 1) ?
"" :
"s", num_found);
28575 #if CYTHON_FAST_THREAD_STATE
28576 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28577 PyObject *tmp_type, *tmp_value, *tmp_tb;
28578 tmp_type = tstate->curexc_type;
28579 tmp_value = tstate->curexc_value;
28580 tmp_tb = tstate->curexc_traceback;
28581 tstate->curexc_type = type;
28582 tstate->curexc_value = value;
28583 tstate->curexc_traceback = tb;
28584 Py_XDECREF(tmp_type);
28585 Py_XDECREF(tmp_value);
28586 Py_XDECREF(tmp_tb);
28588 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28589 *type = tstate->curexc_type;
28590 *value = tstate->curexc_value;
28591 *tb = tstate->curexc_traceback;
28592 tstate->curexc_type = 0;
28593 tstate->curexc_value = 0;
28594 tstate->curexc_traceback = 0;
28600 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
28601 PyFrameObject** frame,
28602 PyThreadState* tstate,
28603 const char *funcname,
28604 const char *srcfile,
28606 PyObject *type, *value, *traceback;
28608 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
28609 if (*code == NULL) {
28610 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
28611 if (*code == NULL)
return 0;
28613 *frame = PyFrame_New(
28619 if (*frame == NULL)
return 0;
28620 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
28621 Py_INCREF(Py_None);
28622 (*frame)->f_trace = Py_None;
28624 #if PY_VERSION_HEX < 0x030400B1
28626 (*frame)->f_tstate = tstate;
28629 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
28631 __Pyx_EnterTracing(tstate);
28632 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
28634 if (tstate->c_tracefunc)
28635 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
28636 if (retval && tstate->c_profilefunc)
28638 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
28639 __Pyx_LeaveTracing(tstate);
28641 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
28642 return __Pyx_IsTracing(tstate, 0, 0) && retval;
28646 Py_XDECREF(traceback);
28650 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
28651 PyCodeObject *py_code = 0;
28652 #if PY_MAJOR_VERSION >= 3
28653 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
28654 if (likely(py_code)) {
28655 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
28658 PyObject *py_srcfile = 0;
28659 PyObject *py_funcname = 0;
28660 py_funcname = PyString_FromString(funcname);
28661 if (unlikely(!py_funcname))
goto bad;
28662 py_srcfile = PyString_FromString(srcfile);
28663 if (unlikely(!py_srcfile))
goto bad;
28664 py_code = PyCode_New(
28668 CO_OPTIMIZED | CO_NEWLOCALS,
28681 Py_XDECREF(py_srcfile);
28682 Py_XDECREF(py_funcname);
28689 #if CYTHON_COMPILING_IN_CPYTHON
28690 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28692 ternaryfunc call = Py_TYPE(func)->tp_call;
28693 if (unlikely(!call))
28694 return PyObject_Call(func, arg, kw);
28695 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
28697 result = (*call)(func, arg, kw);
28698 Py_LeaveRecursiveCall();
28699 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28702 "NULL result without error in PyObject_Call");
28709 #if PY_MAJOR_VERSION < 3
28710 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
28711 CYTHON_UNUSED PyObject *cause) {
28712 __Pyx_PyThreadState_declare
28714 if (!value || value == Py_None)
28718 if (!tb || tb == Py_None)
28722 if (!PyTraceBack_Check(tb)) {
28723 PyErr_SetString(PyExc_TypeError,
28724 "raise: arg 3 must be a traceback or None");
28728 if (PyType_Check(type)) {
28729 #if CYTHON_COMPILING_IN_PYPY
28731 Py_INCREF(Py_None);
28735 PyErr_NormalizeException(&type, &value, &tb);
28738 PyErr_SetString(PyExc_TypeError,
28739 "instance exception may not have a separate value");
28743 type = (PyObject*) Py_TYPE(type);
28745 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
28746 PyErr_SetString(PyExc_TypeError,
28747 "raise: exception class must be a subclass of BaseException");
28751 __Pyx_PyThreadState_assign
28752 __Pyx_ErrRestore(type, value, tb);
28761 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28762 PyObject* owned_instance = NULL;
28763 if (tb == Py_None) {
28765 }
else if (tb && !PyTraceBack_Check(tb)) {
28766 PyErr_SetString(PyExc_TypeError,
28767 "raise: arg 3 must be a traceback or None");
28770 if (value == Py_None)
28772 if (PyExceptionInstance_Check(type)) {
28774 PyErr_SetString(PyExc_TypeError,
28775 "instance exception may not have a separate value");
28779 type = (PyObject*) Py_TYPE(value);
28780 }
else if (PyExceptionClass_Check(type)) {
28781 PyObject *instance_class = NULL;
28782 if (value && PyExceptionInstance_Check(value)) {
28783 instance_class = (PyObject*) Py_TYPE(value);
28784 if (instance_class != type) {
28785 int is_subclass = PyObject_IsSubclass(instance_class, type);
28786 if (!is_subclass) {
28787 instance_class = NULL;
28788 }
else if (unlikely(is_subclass == -1)) {
28791 type = instance_class;
28795 if (!instance_class) {
28798 args = PyTuple_New(0);
28799 else if (PyTuple_Check(value)) {
28803 args = PyTuple_Pack(1, value);
28806 owned_instance = PyObject_Call(type, args, NULL);
28808 if (!owned_instance)
28810 value = owned_instance;
28811 if (!PyExceptionInstance_Check(value)) {
28812 PyErr_Format(PyExc_TypeError,
28813 "calling %R should have returned an instance of "
28814 "BaseException, not %R",
28815 type, Py_TYPE(value));
28820 PyErr_SetString(PyExc_TypeError,
28821 "raise: exception class must be a subclass of BaseException");
28825 PyObject *fixed_cause;
28826 if (cause == Py_None) {
28827 fixed_cause = NULL;
28828 }
else if (PyExceptionClass_Check(cause)) {
28829 fixed_cause = PyObject_CallObject(cause, NULL);
28830 if (fixed_cause == NULL)
28832 }
else if (PyExceptionInstance_Check(cause)) {
28833 fixed_cause = cause;
28834 Py_INCREF(fixed_cause);
28836 PyErr_SetString(PyExc_TypeError,
28837 "exception causes must derive from "
28841 PyException_SetCause(value, fixed_cause);
28843 PyErr_SetObject(type, value);
28845 #if CYTHON_FAST_THREAD_STATE
28846 PyThreadState *tstate = __Pyx_PyThreadState_Current;
28847 PyObject* tmp_tb = tstate->curexc_traceback;
28848 if (tb != tmp_tb) {
28850 tstate->curexc_traceback = tb;
28851 Py_XDECREF(tmp_tb);
28854 PyObject *tmp_type, *tmp_value, *tmp_tb;
28855 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
28857 PyErr_Restore(tmp_type, tmp_value, tb);
28858 Py_XDECREF(tmp_tb);
28862 Py_XDECREF(owned_instance);
28868 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
long inplace) {
28872 #if PY_MAJOR_VERSION < 3
28873 if (likely(PyInt_CheckExact(op1))) {
28874 const long b = intval;
28875 long a = PyInt_AS_LONG(op1);
28876 if (a != b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
28879 #if CYTHON_USE_PYLONG_INTERNALS
28880 if (likely(PyLong_CheckExact(op1))) {
28882 unsigned long uintval;
28883 Py_ssize_t size = Py_SIZE(op1);
28884 const digit* digits = ((PyLongObject*)op1)->ob_digit;
28886 if (size != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
28887 }
else if (intval < 0) {
28896 uintval = (
unsigned long) intval;
28897 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
28898 if (uintval >> (PyLong_SHIFT * 4)) {
28899 unequal = (size != 5) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
28900 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
28903 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
28904 if (uintval >> (PyLong_SHIFT * 3)) {
28905 unequal = (size != 4) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
28906 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
28909 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
28910 if (uintval >> (PyLong_SHIFT * 2)) {
28911 unequal = (size != 3) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
28912 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
28915 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
28916 if (uintval >> (PyLong_SHIFT * 1)) {
28917 unequal = (size != 2) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
28918 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
28921 unequal = (size != 1) || (((
unsigned long) digits[0]) != (uintval & (
unsigned long) PyLong_MASK));
28922 if (unequal != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
28925 if (PyFloat_CheckExact(op1)) {
28926 const long b = intval;
28927 double a = PyFloat_AS_DOUBLE(op1);
28928 if ((
double)a != (
double)b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
28931 PyObject_RichCompare(op1, op2, Py_NE));
28935 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
28936 #if CYTHON_COMPILING_IN_PYPY
28937 return PyObject_RichCompareBool(s1, s2, equals);
28940 return (equals == Py_EQ);
28941 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
28942 const char *ps1, *ps2;
28943 Py_ssize_t length = PyBytes_GET_SIZE(s1);
28944 if (length != PyBytes_GET_SIZE(s2))
28945 return (equals == Py_NE);
28946 ps1 = PyBytes_AS_STRING(s1);
28947 ps2 = PyBytes_AS_STRING(s2);
28948 if (ps1[0] != ps2[0]) {
28949 return (equals == Py_NE);
28950 }
else if (length == 1) {
28951 return (equals == Py_EQ);
28954 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
28955 Py_hash_t hash1, hash2;
28956 hash1 = ((PyBytesObject*)s1)->ob_shash;
28957 hash2 = ((PyBytesObject*)s2)->ob_shash;
28958 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28959 return (equals == Py_NE);
28962 result = memcmp(ps1, ps2, (
size_t)length);
28963 return (equals == Py_EQ) ? (result == 0) : (result != 0);
28965 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
28966 return (equals == Py_NE);
28967 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
28968 return (equals == Py_NE);
28971 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28974 result = __Pyx_PyObject_IsTrue(py_result);
28975 Py_DECREF(py_result);
28982 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
28983 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
28984 PyObject *dict = Py_TYPE(obj)->tp_dict;
28985 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
28987 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
28988 PyObject **dictptr = NULL;
28989 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
28991 #if CYTHON_COMPILING_IN_CPYTHON
28992 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
28994 dictptr = _PyObject_GetDictPtr(obj);
28997 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
28999 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
29000 PyObject *dict = Py_TYPE(obj)->tp_dict;
29001 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
29003 return obj_dict_version == __Pyx_get_object_dict_version(obj);
29008 #if CYTHON_USE_DICT_VERSIONS
29009 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
29011 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
29015 #if !CYTHON_AVOID_BORROWED_REFS
29016 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
29017 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
29018 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29019 if (likely(result)) {
29020 return __Pyx_NewRef(result);
29021 }
else if (unlikely(PyErr_Occurred())) {
29025 result = PyDict_GetItem(__pyx_d, name);
29026 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29027 if (likely(result)) {
29028 return __Pyx_NewRef(result);
29032 result = PyObject_GetItem(__pyx_d, name);
29033 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29034 if (likely(result)) {
29035 return __Pyx_NewRef(result);
29039 return __Pyx_GetBuiltinName(name);
29043 #if CYTHON_FAST_PYCCALL
29044 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
29045 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
29046 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
29047 PyObject *
self = PyCFunction_GET_SELF(func);
29048 int flags = PyCFunction_GET_FLAGS(func);
29049 assert(PyCFunction_Check(func));
29050 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
29051 assert(nargs >= 0);
29052 assert(nargs == 0 || args != NULL);
29056 assert(!PyErr_Occurred());
29057 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
29058 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
29060 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
29066 #if CYTHON_FAST_PYCALL
29067 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
29068 PyObject *globals) {
29070 PyThreadState *tstate = __Pyx_PyThreadState_Current;
29071 PyObject **fastlocals;
29074 assert(globals != NULL);
29079 assert(tstate != NULL);
29080 f = PyFrame_New(tstate, co, globals, NULL);
29084 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
29085 for (i = 0; i < na; i++) {
29087 fastlocals[i] = *args++;
29089 result = PyEval_EvalFrameEx(f,0);
29090 ++tstate->recursion_depth;
29092 --tstate->recursion_depth;
29095 #if 1 || PY_VERSION_HEX < 0x030600B1
29096 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
29097 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
29098 PyObject *globals = PyFunction_GET_GLOBALS(func);
29099 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
29101 #if PY_MAJOR_VERSION >= 3
29104 PyObject *kwtuple, **k;
29109 assert(kwargs == NULL || PyDict_Check(kwargs));
29110 nk = kwargs ? PyDict_Size(kwargs) : 0;
29111 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
29115 #
if PY_MAJOR_VERSION >= 3
29116 co->co_kwonlyargcount == 0 &&
29118 likely(kwargs == NULL || nk == 0) &&
29119 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
29120 if (argdefs == NULL && co->co_argcount == nargs) {
29121 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
29124 else if (nargs == 0 && argdefs != NULL
29125 && co->co_argcount == Py_SIZE(argdefs)) {
29128 args = &PyTuple_GET_ITEM(argdefs, 0);
29129 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
29133 if (kwargs != NULL) {
29135 kwtuple = PyTuple_New(2 * nk);
29136 if (kwtuple == NULL) {
29140 k = &PyTuple_GET_ITEM(kwtuple, 0);
29142 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
29153 closure = PyFunction_GET_CLOSURE(func);
29154 #if PY_MAJOR_VERSION >= 3
29155 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
29157 if (argdefs != NULL) {
29158 d = &PyTuple_GET_ITEM(argdefs, 0);
29159 nd = Py_SIZE(argdefs);
29165 #if PY_MAJOR_VERSION >= 3
29166 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
29169 d, (
int)nd, kwdefs, closure);
29171 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
29174 d, (
int)nd, closure);
29176 Py_XDECREF(kwtuple);
29178 Py_LeaveRecursiveCall();
29185 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
29186 PyObject *args, *result = NULL;
29187 #if CYTHON_FAST_PYCALL
29188 if (PyFunction_Check(
function)) {
29189 PyObject *args[2] = {arg1, arg2};
29190 return __Pyx_PyFunction_FastCall(
function, args, 2);
29193 #if CYTHON_FAST_PYCCALL
29194 if (__Pyx_PyFastCFunction_Check(
function)) {
29195 PyObject *args[2] = {arg1, arg2};
29196 return __Pyx_PyCFunction_FastCall(
function, args, 2);
29199 args = PyTuple_New(2);
29200 if (unlikely(!args))
goto done;
29202 PyTuple_SET_ITEM(args, 0, arg1);
29204 PyTuple_SET_ITEM(args, 1, arg2);
29205 Py_INCREF(
function);
29206 result = __Pyx_PyObject_Call(
function, args, NULL);
29208 Py_DECREF(
function);
29214 #if CYTHON_COMPILING_IN_CPYTHON
29215 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
29216 PyObject *
self, *result;
29218 cfunc = PyCFunction_GET_FUNCTION(func);
29219 self = PyCFunction_GET_SELF(func);
29220 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
29222 result = cfunc(
self, arg);
29223 Py_LeaveRecursiveCall();
29224 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29227 "NULL result without error in PyObject_Call");
29234 #if CYTHON_COMPILING_IN_CPYTHON
29235 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29237 PyObject *args = PyTuple_New(1);
29238 if (unlikely(!args))
return NULL;
29240 PyTuple_SET_ITEM(args, 0, arg);
29241 result = __Pyx_PyObject_Call(func, args, NULL);
29245 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29246 #if CYTHON_FAST_PYCALL
29247 if (PyFunction_Check(func)) {
29248 return __Pyx_PyFunction_FastCall(func, &arg, 1);
29251 if (likely(PyCFunction_Check(func))) {
29252 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
29253 return __Pyx_PyObject_CallMethO(func, arg);
29254 #if CYTHON_FAST_PYCCALL
29255 }
else if (__Pyx_PyFastCFunction_Check(func)) {
29256 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
29260 return __Pyx__PyObject_CallOneArg(func, arg);
29263 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29265 PyObject *args = PyTuple_Pack(1, arg);
29266 if (unlikely(!args))
return NULL;
29267 result = __Pyx_PyObject_Call(func, args, NULL);
29274 #if CYTHON_COMPILING_IN_CPYTHON
29275 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
29276 #if CYTHON_FAST_PYCALL
29277 if (PyFunction_Check(func)) {
29278 return __Pyx_PyFunction_FastCall(func, NULL, 0);
29281 #if defined(__Pyx_CyFunction_USED) && defined(NDEBUG)
29282 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
29284 if (likely(PyCFunction_Check(func)))
29287 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
29288 return __Pyx_PyObject_CallMethO(func, NULL);
29291 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
29296 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
29298 if (!j)
return NULL;
29299 r = PyObject_GetItem(o, j);
29303 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
29304 CYTHON_NCP_UNUSED
int wraparound,
29305 CYTHON_NCP_UNUSED
int boundscheck) {
29306 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29307 Py_ssize_t wrapped_i = i;
29308 if (wraparound & unlikely(i < 0)) {
29309 wrapped_i += PyList_GET_SIZE(o);
29311 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
29312 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
29316 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29318 return PySequence_GetItem(o, i);
29321 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
29322 CYTHON_NCP_UNUSED
int wraparound,
29323 CYTHON_NCP_UNUSED
int boundscheck) {
29324 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29325 Py_ssize_t wrapped_i = i;
29326 if (wraparound & unlikely(i < 0)) {
29327 wrapped_i += PyTuple_GET_SIZE(o);
29329 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
29330 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
29334 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29336 return PySequence_GetItem(o, i);
29339 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
29340 CYTHON_NCP_UNUSED
int wraparound,
29341 CYTHON_NCP_UNUSED
int boundscheck) {
29342 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29343 if (is_list || PyList_CheckExact(o)) {
29344 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
29345 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
29346 PyObject *r = PyList_GET_ITEM(o, n);
29351 else if (PyTuple_CheckExact(o)) {
29352 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
29353 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
29354 PyObject *r = PyTuple_GET_ITEM(o, n);
29359 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
29360 if (likely(m && m->sq_item)) {
29361 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
29362 Py_ssize_t l = m->sq_length(o);
29363 if (likely(l >= 0)) {
29366 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
29371 return m->sq_item(o, i);
29375 if (is_list || PySequence_Check(o)) {
29376 return PySequence_GetItem(o, i);
29379 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29383 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
29384 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
29386 value = PyDict_GetItemWithError(d, key);
29387 if (unlikely(!value)) {
29388 if (!PyErr_Occurred()) {
29389 if (unlikely(PyTuple_Check(key))) {
29390 PyObject* args = PyTuple_Pack(1, key);
29391 if (likely(args)) {
29392 PyErr_SetObject(PyExc_KeyError, args);
29396 PyErr_SetObject(PyExc_KeyError, key);
29408 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
29410 __Pyx_memviewslice *memviewslice,
29411 int memview_is_new_reference)
29413 __Pyx_RefNannyDeclarations
29415 Py_buffer *buf = &memview->view;
29416 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
29417 if (unlikely(memviewslice->memview || memviewslice->data)) {
29418 PyErr_SetString(PyExc_ValueError,
29419 "memviewslice is already initialized!");
29422 if (buf->strides) {
29423 for (i = 0; i < ndim; i++) {
29424 memviewslice->strides[i] = buf->strides[i];
29427 Py_ssize_t stride = buf->itemsize;
29428 for (i = ndim - 1; i >= 0; i--) {
29429 memviewslice->strides[i] = stride;
29430 stride *= buf->shape[i];
29433 for (i = 0; i < ndim; i++) {
29434 memviewslice->shape[i] = buf->shape[i];
29435 if (buf->suboffsets) {
29436 memviewslice->suboffsets[i] = buf->suboffsets[i];
29438 memviewslice->suboffsets[i] = -1;
29441 memviewslice->memview = memview;
29442 memviewslice->data = (
char *)buf->buf;
29443 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
29444 Py_INCREF(memview);
29449 memviewslice->memview = 0;
29450 memviewslice->data = 0;
29453 __Pyx_RefNannyFinishContext();
29456 #ifndef Py_NO_RETURN
29457 #define Py_NO_RETURN
29459 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
29462 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
29463 va_start(vargs, fmt);
29467 vsnprintf(msg, 200, fmt, vargs);
29469 Py_FatalError(msg);
29471 static CYTHON_INLINE
int
29472 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
29473 PyThread_type_lock lock)
29476 PyThread_acquire_lock(lock, 1);
29477 result = (*acquisition_count)++;
29478 PyThread_release_lock(lock);
29481 static CYTHON_INLINE
int
29482 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
29483 PyThread_type_lock lock)
29486 PyThread_acquire_lock(lock, 1);
29487 result = (*acquisition_count)--;
29488 PyThread_release_lock(lock);
29491 static CYTHON_INLINE
void
29492 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
29495 struct __pyx_memoryview_obj *memview = memslice->memview;
29496 if (unlikely(!memview || (PyObject *) memview == Py_None))
29498 if (unlikely(__pyx_get_slice_count(memview) < 0))
29499 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
29500 __pyx_get_slice_count(memview), lineno);
29501 first_time = __pyx_add_acquisition_count(memview) == 0;
29502 if (unlikely(first_time)) {
29504 Py_INCREF((PyObject *) memview);
29506 PyGILState_STATE _gilstate = PyGILState_Ensure();
29507 Py_INCREF((PyObject *) memview);
29508 PyGILState_Release(_gilstate);
29512 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
29513 int have_gil,
int lineno) {
29515 struct __pyx_memoryview_obj *memview = memslice->memview;
29516 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
29517 memslice->memview = NULL;
29520 if (unlikely(__pyx_get_slice_count(memview) <= 0))
29521 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
29522 __pyx_get_slice_count(memview), lineno);
29523 last_time = __pyx_sub_acquisition_count(memview) == 1;
29524 memslice->data = NULL;
29525 if (unlikely(last_time)) {
29527 Py_CLEAR(memslice->memview);
29529 PyGILState_STATE _gilstate = PyGILState_Ensure();
29530 Py_CLEAR(memslice->memview);
29531 PyGILState_Release(_gilstate);
29534 memslice->memview = NULL;
29539 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
29541 if (unlikely(!type)) {
29542 PyErr_SetString(PyExc_SystemError,
"Missing type object");
29546 #if PY_MAJOR_VERSION == 2
29547 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
29551 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
29553 PyErr_Format(PyExc_TypeError,
29554 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
29555 name, type->tp_name, Py_TYPE(obj)->tp_name);
29560 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
29561 #if CYTHON_COMPILING_IN_PYPY
29562 return PyObject_RichCompareBool(s1, s2, equals);
29564 #if PY_MAJOR_VERSION < 3
29565 PyObject* owned_ref = NULL;
29567 int s1_is_unicode, s2_is_unicode;
29571 s1_is_unicode = PyUnicode_CheckExact(s1);
29572 s2_is_unicode = PyUnicode_CheckExact(s2);
29573 #if PY_MAJOR_VERSION < 3
29574 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
29575 owned_ref = PyUnicode_FromObject(s2);
29576 if (unlikely(!owned_ref))
29580 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
29581 owned_ref = PyUnicode_FromObject(s1);
29582 if (unlikely(!owned_ref))
29586 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
29587 return __Pyx_PyBytes_Equals(s1, s2, equals);
29590 if (s1_is_unicode & s2_is_unicode) {
29593 void *data1, *data2;
29594 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
29596 length = __Pyx_PyUnicode_GET_LENGTH(s1);
29597 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
29600 #if CYTHON_USE_UNICODE_INTERNALS
29602 Py_hash_t hash1, hash2;
29603 #if CYTHON_PEP393_ENABLED
29604 hash1 = ((PyASCIIObject*)s1)->hash;
29605 hash2 = ((PyASCIIObject*)s2)->hash;
29607 hash1 = ((PyUnicodeObject*)s1)->hash;
29608 hash2 = ((PyUnicodeObject*)s2)->hash;
29610 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
29615 kind = __Pyx_PyUnicode_KIND(s1);
29616 if (kind != __Pyx_PyUnicode_KIND(s2)) {
29619 data1 = __Pyx_PyUnicode_DATA(s1);
29620 data2 = __Pyx_PyUnicode_DATA(s2);
29621 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
29623 }
else if (length == 1) {
29626 int result = memcmp(data1, data2, (
size_t)(length * kind));
29627 #if PY_MAJOR_VERSION < 3
29628 Py_XDECREF(owned_ref);
29630 return (equals == Py_EQ) ? (result == 0) : (result != 0);
29632 }
else if ((s1 == Py_None) & s2_is_unicode) {
29634 }
else if ((s2 == Py_None) & s1_is_unicode) {
29638 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
29639 #if PY_MAJOR_VERSION < 3
29640 Py_XDECREF(owned_ref);
29644 result = __Pyx_PyObject_IsTrue(py_result);
29645 Py_DECREF(py_result);
29649 #if PY_MAJOR_VERSION < 3
29650 Py_XDECREF(owned_ref);
29652 return (equals == Py_EQ);
29654 #if PY_MAJOR_VERSION < 3
29655 Py_XDECREF(owned_ref);
29657 return (equals == Py_NE);
29662 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
29663 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
29664 int full_traceback, CYTHON_UNUSED
int nogil) {
29665 PyObject *old_exc, *old_val, *old_tb;
29667 __Pyx_PyThreadState_declare
29669 PyGILState_STATE state;
29671 state = PyGILState_Ensure();
29672 else state = (PyGILState_STATE)0;
29674 __Pyx_PyThreadState_assign
29675 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
29676 if (full_traceback) {
29677 Py_XINCREF(old_exc);
29678 Py_XINCREF(old_val);
29679 Py_XINCREF(old_tb);
29680 __Pyx_ErrRestore(old_exc, old_val, old_tb);
29683 #if PY_MAJOR_VERSION < 3
29684 ctx = PyString_FromString(name);
29686 ctx = PyUnicode_FromString(name);
29688 __Pyx_ErrRestore(old_exc, old_val, old_tb);
29690 PyErr_WriteUnraisable(Py_None);
29692 PyErr_WriteUnraisable(ctx);
29697 PyGILState_Release(state);
29702 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
29703 #if CYTHON_USE_TYPE_SLOTS
29704 #if PY_MAJOR_VERSION >= 3
29705 if (likely(PyUnicode_Check(n)))
29707 if (likely(PyString_Check(n)))
29709 return __Pyx_PyObject_GetAttrStr(o, n);
29711 return PyObject_GetAttr(o, n);
29715 #if CYTHON_USE_TYPE_SLOTS
29716 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
29717 PyObject *runerr = NULL;
29718 Py_ssize_t key_value;
29719 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
29720 if (unlikely(!(m && m->sq_item))) {
29721 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
29724 key_value = __Pyx_PyIndex_AsSsize_t(index);
29725 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
29726 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
29728 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
29730 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
29734 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
29735 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
29736 if (likely(m && m->mp_subscript)) {
29737 return m->mp_subscript(obj, key);
29739 return __Pyx_PyObject_GetIndex(obj, key);
29744 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
29745 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
29746 const char* encoding,
const char* errors,
29747 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
29749 if (unlikely((start < 0) | (stop < 0))) {
29750 size_t slen = strlen(cstring);
29751 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
29752 PyErr_SetString(PyExc_OverflowError,
29753 "c-string too long to convert to Python");
29756 length = (Py_ssize_t) slen;
29765 if (unlikely(stop <= start))
29766 return __Pyx_NewRef(__pyx_empty_unicode);
29767 length = stop - start;
29770 return decode_func(cstring, length, errors);
29772 return PyUnicode_Decode(cstring, length, encoding, errors);
29777 #if CYTHON_FAST_THREAD_STATE
29778 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29780 n = PyTuple_GET_SIZE(tuple);
29781 #if PY_MAJOR_VERSION >= 3
29782 for (i=0; i<n; i++) {
29783 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
29786 for (i=0; i<n; i++) {
29787 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
29791 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
29792 PyObject *exc_type = tstate->curexc_type;
29793 if (exc_type == err)
return 1;
29794 if (unlikely(!exc_type))
return 0;
29795 if (unlikely(PyTuple_Check(err)))
29796 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
29797 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
29802 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
29803 __Pyx_PyThreadState_declare
29804 __Pyx_PyThreadState_assign
29805 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
29807 __Pyx_PyErr_Clear();
29811 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
29812 PyObject *r = __Pyx_GetAttr(o, n);
29813 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
29817 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
29818 PyErr_Format(PyExc_ValueError,
29819 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
29823 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
29824 PyErr_Format(PyExc_ValueError,
29825 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
29826 index, (index == 1) ?
"" :
"s");
29830 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
29831 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
29835 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
29836 if (unlikely(!type)) {
29837 PyErr_SetString(PyExc_SystemError,
"Missing type object");
29840 if (likely(__Pyx_TypeCheck(obj, type)))
29842 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
29843 Py_TYPE(obj)->tp_name, type->tp_name);
29848 #if CYTHON_USE_EXC_INFO_STACK
29849 static _PyErr_StackItem *
29850 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
29852 _PyErr_StackItem *exc_info = tstate->exc_info;
29853 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
29854 exc_info->previous_item != NULL)
29856 exc_info = exc_info->previous_item;
29863 #if CYTHON_FAST_THREAD_STATE
29864 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29865 #if CYTHON_USE_EXC_INFO_STACK
29866 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
29867 *type = exc_info->exc_type;
29868 *value = exc_info->exc_value;
29869 *tb = exc_info->exc_traceback;
29871 *type = tstate->exc_type;
29872 *value = tstate->exc_value;
29873 *tb = tstate->exc_traceback;
29876 Py_XINCREF(*value);
29879 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29880 PyObject *tmp_type, *tmp_value, *tmp_tb;
29881 #if CYTHON_USE_EXC_INFO_STACK
29882 _PyErr_StackItem *exc_info = tstate->exc_info;
29883 tmp_type = exc_info->exc_type;
29884 tmp_value = exc_info->exc_value;
29885 tmp_tb = exc_info->exc_traceback;
29886 exc_info->exc_type = type;
29887 exc_info->exc_value = value;
29888 exc_info->exc_traceback = tb;
29890 tmp_type = tstate->exc_type;
29891 tmp_value = tstate->exc_value;
29892 tmp_tb = tstate->exc_traceback;
29893 tstate->exc_type = type;
29894 tstate->exc_value = value;
29895 tstate->exc_traceback = tb;
29897 Py_XDECREF(tmp_type);
29898 Py_XDECREF(tmp_value);
29899 Py_XDECREF(tmp_tb);
29904 #if CYTHON_FAST_THREAD_STATE
29905 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
29907 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
29910 PyObject *local_type, *local_value, *local_tb;
29911 #if CYTHON_FAST_THREAD_STATE
29912 PyObject *tmp_type, *tmp_value, *tmp_tb;
29913 local_type = tstate->curexc_type;
29914 local_value = tstate->curexc_value;
29915 local_tb = tstate->curexc_traceback;
29916 tstate->curexc_type = 0;
29917 tstate->curexc_value = 0;
29918 tstate->curexc_traceback = 0;
29920 PyErr_Fetch(&local_type, &local_value, &local_tb);
29922 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
29923 #if CYTHON_FAST_THREAD_STATE
29924 if (unlikely(tstate->curexc_type))
29926 if (unlikely(PyErr_Occurred()))
29929 #if PY_MAJOR_VERSION >= 3
29931 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
29935 Py_XINCREF(local_tb);
29936 Py_XINCREF(local_type);
29937 Py_XINCREF(local_value);
29938 *type = local_type;
29939 *value = local_value;
29941 #if CYTHON_FAST_THREAD_STATE
29942 #if CYTHON_USE_EXC_INFO_STACK
29944 _PyErr_StackItem *exc_info = tstate->exc_info;
29945 tmp_type = exc_info->exc_type;
29946 tmp_value = exc_info->exc_value;
29947 tmp_tb = exc_info->exc_traceback;
29948 exc_info->exc_type = local_type;
29949 exc_info->exc_value = local_value;
29950 exc_info->exc_traceback = local_tb;
29953 tmp_type = tstate->exc_type;
29954 tmp_value = tstate->exc_value;
29955 tmp_tb = tstate->exc_traceback;
29956 tstate->exc_type = local_type;
29957 tstate->exc_value = local_value;
29958 tstate->exc_traceback = local_tb;
29960 Py_XDECREF(tmp_type);
29961 Py_XDECREF(tmp_value);
29962 Py_XDECREF(tmp_tb);
29964 PyErr_SetExcInfo(local_type, local_value, local_tb);
29971 Py_XDECREF(local_type);
29972 Py_XDECREF(local_value);
29973 Py_XDECREF(local_tb);
29978 #if CYTHON_FAST_THREAD_STATE
29979 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29980 PyObject *tmp_type, *tmp_value, *tmp_tb;
29981 #if CYTHON_USE_EXC_INFO_STACK
29982 _PyErr_StackItem *exc_info = tstate->exc_info;
29983 tmp_type = exc_info->exc_type;
29984 tmp_value = exc_info->exc_value;
29985 tmp_tb = exc_info->exc_traceback;
29986 exc_info->exc_type = *type;
29987 exc_info->exc_value = *value;
29988 exc_info->exc_traceback = *tb;
29990 tmp_type = tstate->exc_type;
29991 tmp_value = tstate->exc_value;
29992 tmp_tb = tstate->exc_traceback;
29993 tstate->exc_type = *type;
29994 tstate->exc_value = *value;
29995 tstate->exc_traceback = *tb;
29998 *value = tmp_value;
30002 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
30003 PyObject *tmp_type, *tmp_value, *tmp_tb;
30004 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
30005 PyErr_SetExcInfo(*type, *value, *tb);
30007 *value = tmp_value;
30013 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
30014 PyObject *empty_list = 0;
30015 PyObject *module = 0;
30016 PyObject *global_dict = 0;
30017 PyObject *empty_dict = 0;
30019 #if PY_MAJOR_VERSION < 3
30020 PyObject *py_import;
30021 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
30028 empty_list = PyList_New(0);
30033 global_dict = PyModule_GetDict(__pyx_m);
30036 empty_dict = PyDict_New();
30040 #if PY_MAJOR_VERSION >= 3
30042 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
30043 module = PyImport_ImportModuleLevelObject(
30044 name, global_dict, empty_dict, list, 1);
30046 if (!PyErr_ExceptionMatches(PyExc_ImportError))
30055 #if PY_MAJOR_VERSION < 3
30056 PyObject *py_level = PyInt_FromLong(level);
30059 module = PyObject_CallFunctionObjArgs(py_import,
30060 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
30061 Py_DECREF(py_level);
30063 module = PyImport_ImportModuleLevelObject(
30064 name, global_dict, empty_dict, list, level);
30069 #if PY_MAJOR_VERSION < 3
30070 Py_XDECREF(py_import);
30072 Py_XDECREF(empty_list);
30073 Py_XDECREF(empty_dict);
30078 #if CYTHON_COMPILING_IN_CPYTHON
30079 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
30085 return b == &PyBaseObject_Type;
30087 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
30089 if (a == b)
return 1;
30093 n = PyTuple_GET_SIZE(mro);
30094 for (i = 0; i < n; i++) {
30095 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
30100 return __Pyx_InBases(a, b);
30102 #if PY_MAJOR_VERSION == 2
30103 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
30104 PyObject *exception, *value, *tb;
30106 __Pyx_PyThreadState_declare
30107 __Pyx_PyThreadState_assign
30108 __Pyx_ErrFetch(&exception, &value, &tb);
30109 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
30110 if (unlikely(res == -1)) {
30111 PyErr_WriteUnraisable(err);
30115 res = PyObject_IsSubclass(err, exc_type2);
30116 if (unlikely(res == -1)) {
30117 PyErr_WriteUnraisable(err);
30121 __Pyx_ErrRestore(exception, value, tb);
30125 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
30126 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
30128 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
30133 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
30135 assert(PyExceptionClass_Check(exc_type));
30136 n = PyTuple_GET_SIZE(tuple);
30137 #if PY_MAJOR_VERSION >= 3
30138 for (i=0; i<n; i++) {
30139 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
30142 for (i=0; i<n; i++) {
30143 PyObject *t = PyTuple_GET_ITEM(tuple, i);
30144 #if PY_MAJOR_VERSION < 3
30145 if (likely(exc_type == t))
return 1;
30147 if (likely(PyExceptionClass_Check(t))) {
30148 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
30154 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
30155 if (likely(err == exc_type))
return 1;
30156 if (likely(PyExceptionClass_Check(err))) {
30157 if (likely(PyExceptionClass_Check(exc_type))) {
30158 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
30159 }
else if (likely(PyTuple_Check(exc_type))) {
30160 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
30164 return PyErr_GivenExceptionMatches(err, exc_type);
30166 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
30167 assert(PyExceptionClass_Check(exc_type1));
30168 assert(PyExceptionClass_Check(exc_type2));
30169 if (likely(err == exc_type1 || err == exc_type2))
return 1;
30170 if (likely(PyExceptionClass_Check(err))) {
30171 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
30173 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
30178 #if !CYTHON_COMPILING_IN_PYPY
30179 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
30181 (void)zerodivision_check;
30182 #if PY_MAJOR_VERSION < 3
30183 if (likely(PyInt_CheckExact(op1))) {
30184 const long b = intval;
30186 long a = PyInt_AS_LONG(op1);
30187 x = (long)((
unsigned long)a + b);
30188 if (likely((x^a) >= 0 || (x^b) >= 0))
30189 return PyInt_FromLong(x);
30190 return PyLong_Type.tp_as_number->nb_add(op1, op2);
30193 #if CYTHON_USE_PYLONG_INTERNALS
30194 if (likely(PyLong_CheckExact(op1))) {
30195 const long b = intval;
30197 #ifdef HAVE_LONG_LONG
30198 const PY_LONG_LONG llb = intval;
30199 PY_LONG_LONG lla, llx;
30201 const digit* digits = ((PyLongObject*)op1)->ob_digit;
30202 const Py_ssize_t size = Py_SIZE(op1);
30203 if (likely(__Pyx_sst_abs(size) <= 1)) {
30204 a = likely(size) ? digits[0] : 0;
30205 if (size == -1) a = -a;
30209 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
30210 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
30212 #ifdef HAVE_LONG_LONG
30213 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30214 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
30218 CYTHON_FALLTHROUGH;
30220 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
30221 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
30223 #ifdef HAVE_LONG_LONG
30224 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30225 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
30229 CYTHON_FALLTHROUGH;
30231 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
30232 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
30234 #ifdef HAVE_LONG_LONG
30235 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30236 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
30240 CYTHON_FALLTHROUGH;
30242 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
30243 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
30245 #ifdef HAVE_LONG_LONG
30246 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30247 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
30251 CYTHON_FALLTHROUGH;
30253 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
30254 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
30256 #ifdef HAVE_LONG_LONG
30257 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30258 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
30262 CYTHON_FALLTHROUGH;
30264 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
30265 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
30267 #ifdef HAVE_LONG_LONG
30268 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30269 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
30273 CYTHON_FALLTHROUGH;
30274 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
30278 return PyLong_FromLong(x);
30279 #ifdef HAVE_LONG_LONG
30282 return PyLong_FromLongLong(llx);
30288 if (PyFloat_CheckExact(op1)) {
30289 const long b = intval;
30290 double a = PyFloat_AS_DOUBLE(op1);
30292 PyFPE_START_PROTECT(
"add",
return NULL)
30293 result = ((double)a) + (double)b;
30294 PyFPE_END_PROTECT(result)
30295 return PyFloat_FromDouble(result);
30297 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
30302 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
30303 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
30307 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
30308 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
30309 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
30310 PyErr_Format(PyExc_ImportError,
30311 #
if PY_MAJOR_VERSION < 3
30312 "cannot import name %.230s", PyString_AS_STRING(name));
30314 "cannot import name %S", name);
30321 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *n) {
30323 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
30324 PyErr_SetString(PyExc_TypeError,
30325 "hasattr(): attribute name must be string");
30328 r = __Pyx_GetAttr(o, n);
30329 if (unlikely(!r)) {
30339 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
30340 PyTypeObject* type = Py_TYPE(obj);
30341 while (type && type->tp_dealloc != current_tp_dealloc)
30342 type = type->tp_base;
30343 while (type && type->tp_dealloc == current_tp_dealloc)
30344 type = type->tp_base;
30346 type->tp_dealloc(obj);
30350 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v,
void *a, traverseproc current_tp_traverse) {
30351 PyTypeObject* type = Py_TYPE(obj);
30352 while (type && type->tp_traverse != current_tp_traverse)
30353 type = type->tp_base;
30354 while (type && type->tp_traverse == current_tp_traverse)
30355 type = type->tp_base;
30356 if (type && type->tp_traverse)
30357 return type->tp_traverse(obj, v, a);
30362 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
30363 PyTypeObject* type = Py_TYPE(obj);
30364 while (type && type->tp_clear != current_tp_clear)
30365 type = type->tp_base;
30366 while (type && type->tp_clear == current_tp_clear)
30367 type = type->tp_base;
30368 if (type && type->tp_clear)
30369 type->tp_clear(obj);
30373 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30374 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
30375 PyErr_Format(PyExc_AttributeError,
30376 #
if PY_MAJOR_VERSION >= 3
30377 "'%.50s' object has no attribute '%U'",
30378 tp->tp_name, attr_name);
30380 "'%.50s' object has no attribute '%.400s'",
30381 tp->tp_name, PyString_AS_STRING(attr_name));
30385 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
30387 PyTypeObject *tp = Py_TYPE(obj);
30388 if (unlikely(!PyString_Check(attr_name))) {
30389 return PyObject_GenericGetAttr(obj, attr_name);
30391 assert(!tp->tp_dictoffset);
30392 descr = _PyType_Lookup(tp, attr_name);
30393 if (unlikely(!descr)) {
30394 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
30397 #if PY_MAJOR_VERSION < 3
30398 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
30401 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
30403 PyObject *res = f(descr, obj, (PyObject *)tp);
30413 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30414 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
30415 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
30416 return PyObject_GenericGetAttr(obj, attr_name);
30418 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
30423 #ifndef __PYX_HAVE_RT_ImportType_0_29_36
30424 #define __PYX_HAVE_RT_ImportType_0_29_36
30425 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module,
const char *module_name,
const char *class_name,
30426 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_0_29_36 check_size)
30428 PyObject *result = 0;
30430 Py_ssize_t basicsize;
30431 Py_ssize_t itemsize;
30432 #ifdef Py_LIMITED_API
30433 PyObject *py_basicsize;
30434 PyObject *py_itemsize;
30436 result = PyObject_GetAttrString(module, class_name);
30439 if (!PyType_Check(result)) {
30440 PyErr_Format(PyExc_TypeError,
30441 "%.200s.%.200s is not a type object",
30442 module_name, class_name);
30445 #ifndef Py_LIMITED_API
30446 basicsize = ((PyTypeObject *)result)->tp_basicsize;
30447 itemsize = ((PyTypeObject *)result)->tp_itemsize;
30449 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
30452 basicsize = PyLong_AsSsize_t(py_basicsize);
30453 Py_DECREF(py_basicsize);
30455 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
30457 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
30460 itemsize = PyLong_AsSsize_t(py_itemsize);
30461 Py_DECREF(py_itemsize);
30463 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
30467 if (size % alignment) {
30468 alignment = size % alignment;
30470 if (itemsize < (Py_ssize_t)alignment)
30471 itemsize = (Py_ssize_t)alignment;
30473 if ((
size_t)(basicsize + itemsize) < size) {
30474 PyErr_Format(PyExc_ValueError,
30475 "%.200s.%.200s size changed, may indicate binary incompatibility. "
30476 "Expected %zd from C header, got %zd from PyObject",
30477 module_name, class_name, size, basicsize);
30480 if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (
size_t)basicsize != size) {
30481 PyErr_Format(PyExc_ValueError,
30482 "%.200s.%.200s size changed, may indicate binary incompatibility. "
30483 "Expected %zd from C header, got %zd from PyObject",
30484 module_name, class_name, size, basicsize);
30487 else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (
size_t)basicsize > size) {
30488 PyOS_snprintf(warning,
sizeof(warning),
30489 "%s.%s size changed, may indicate binary incompatibility. "
30490 "Expected %zd from C header, got %zd from PyObject",
30491 module_name, class_name, size, basicsize);
30492 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
30494 return (PyTypeObject *)result;
30496 Py_XDECREF(result);
30502 static void* __Pyx_GetVtable(PyObject *dict) {
30504 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
30507 #if PY_VERSION_HEX >= 0x02070000
30508 ptr = PyCapsule_GetPointer(ob, 0);
30510 ptr = PyCObject_AsVoidPtr(ob);
30512 if (!ptr && !PyErr_Occurred())
30513 PyErr_SetString(PyExc_RuntimeError,
"invalid vtable found for imported type");
30522 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
30523 #if PY_VERSION_HEX >= 0x02070000
30524 PyObject *ob = PyCapsule_New(vtable, 0, 0);
30526 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
30530 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
30540 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
30541 __Pyx_PyThreadState_declare
30542 __Pyx_PyThreadState_assign
30543 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30544 __Pyx_PyErr_Clear();
30546 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
30548 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
30549 PyTypeObject* tp = Py_TYPE(obj);
30550 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
30551 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
30554 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
30555 if (unlikely(!result)) {
30556 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
30562 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
30564 PyObject *name_attr;
30565 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
30566 if (likely(name_attr)) {
30567 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
30571 if (unlikely(ret < 0)) {
30575 Py_XDECREF(name_attr);
30578 static int __Pyx_setup_reduce(PyObject* type_obj) {
30580 PyObject *object_reduce = NULL;
30581 PyObject *object_getstate = NULL;
30582 PyObject *object_reduce_ex = NULL;
30583 PyObject *reduce = NULL;
30584 PyObject *reduce_ex = NULL;
30585 PyObject *reduce_cython = NULL;
30586 PyObject *setstate = NULL;
30587 PyObject *setstate_cython = NULL;
30588 PyObject *getstate = NULL;
30589 #if CYTHON_USE_PYTYPE_LOOKUP
30590 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
30592 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
30593 if (!getstate && PyErr_Occurred()) {
30598 #if CYTHON_USE_PYTYPE_LOOKUP
30599 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
30601 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
30602 if (!object_getstate && PyErr_Occurred()) {
30606 if (object_getstate != getstate) {
30610 #if CYTHON_USE_PYTYPE_LOOKUP
30611 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
30613 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
30615 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
30616 if (reduce_ex == object_reduce_ex) {
30617 #if CYTHON_USE_PYTYPE_LOOKUP
30618 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
30620 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
30622 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
30623 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
30624 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
30625 if (likely(reduce_cython)) {
30626 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
30627 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
30628 }
else if (reduce == object_reduce || PyErr_Occurred()) {
30631 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
30632 if (!setstate) PyErr_Clear();
30633 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
30634 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
30635 if (likely(setstate_cython)) {
30636 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
30637 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
30638 }
else if (!setstate || PyErr_Occurred()) {
30642 PyType_Modified((PyTypeObject*)type_obj);
30647 if (!PyErr_Occurred())
30648 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
30651 #if !CYTHON_USE_PYTYPE_LOOKUP
30652 Py_XDECREF(object_reduce);
30653 Py_XDECREF(object_reduce_ex);
30654 Py_XDECREF(object_getstate);
30655 Py_XDECREF(getstate);
30657 Py_XDECREF(reduce);
30658 Py_XDECREF(reduce_ex);
30659 Py_XDECREF(reduce_cython);
30660 Py_XDECREF(setstate);
30661 Py_XDECREF(setstate_cython);
30666 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
30667 PyObject* fake_module;
30668 PyTypeObject* cached_type = NULL;
30669 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
30670 if (!fake_module)
return NULL;
30671 Py_INCREF(fake_module);
30672 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
30674 if (!PyType_Check((PyObject*)cached_type)) {
30675 PyErr_Format(PyExc_TypeError,
30676 "Shared Cython type %.200s is not a type object",
30680 if (cached_type->tp_basicsize != type->tp_basicsize) {
30681 PyErr_Format(PyExc_TypeError,
30682 "Shared Cython type %.200s has the wrong size, try recompiling",
30687 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
30689 if (PyType_Ready(type) < 0)
goto bad;
30690 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
30693 cached_type = type;
30696 Py_DECREF(fake_module);
30697 return cached_type;
30699 Py_XDECREF(cached_type);
30700 cached_type = NULL;
30705 #include <structmember.h>
30707 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
30709 if (unlikely(op->func_doc == NULL)) {
30710 if (op->func.m_ml->ml_doc) {
30711 #if PY_MAJOR_VERSION >= 3
30712 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
30714 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
30716 if (unlikely(op->func_doc == NULL))
30719 Py_INCREF(Py_None);
30723 Py_INCREF(op->func_doc);
30724 return op->func_doc;
30727 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
30729 PyObject *tmp = op->func_doc;
30730 if (value == NULL) {
30734 op->func_doc = value;
30739 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30741 if (unlikely(op->func_name == NULL)) {
30742 #if PY_MAJOR_VERSION >= 3
30743 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
30745 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
30747 if (unlikely(op->func_name == NULL))
30750 Py_INCREF(op->func_name);
30751 return op->func_name;
30754 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
30757 #if PY_MAJOR_VERSION >= 3
30758 if (unlikely(value == NULL || !PyUnicode_Check(value)))
30760 if (unlikely(value == NULL || !PyString_Check(value)))
30763 PyErr_SetString(PyExc_TypeError,
30764 "__name__ must be set to a string object");
30767 tmp = op->func_name;
30769 op->func_name = value;
30774 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30776 Py_INCREF(op->func_qualname);
30777 return op->func_qualname;
30780 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
30783 #if PY_MAJOR_VERSION >= 3
30784 if (unlikely(value == NULL || !PyUnicode_Check(value)))
30786 if (unlikely(value == NULL || !PyString_Check(value)))
30789 PyErr_SetString(PyExc_TypeError,
30790 "__qualname__ must be set to a string object");
30793 tmp = op->func_qualname;
30795 op->func_qualname = value;
30800 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
30803 self = m->func_closure;
30810 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30812 if (unlikely(op->func_dict == NULL)) {
30813 op->func_dict = PyDict_New();
30814 if (unlikely(op->func_dict == NULL))
30817 Py_INCREF(op->func_dict);
30818 return op->func_dict;
30821 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
30824 if (unlikely(value == NULL)) {
30825 PyErr_SetString(PyExc_TypeError,
30826 "function's dictionary may not be deleted");
30829 if (unlikely(!PyDict_Check(value))) {
30830 PyErr_SetString(PyExc_TypeError,
30831 "setting function's dictionary to a non-dict");
30834 tmp = op->func_dict;
30836 op->func_dict = value;
30841 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30843 Py_INCREF(op->func_globals);
30844 return op->func_globals;
30847 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30849 Py_INCREF(Py_None);
30853 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
30855 PyObject* result = (op->func_code) ? op->func_code : Py_None;
30860 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
30862 PyObject *res = op->defaults_getter((PyObject *) op);
30863 if (unlikely(!res))
30865 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30866 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
30867 Py_INCREF(op->defaults_tuple);
30868 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
30869 Py_INCREF(op->defaults_kwdict);
30871 op->defaults_tuple = PySequence_ITEM(res, 0);
30872 if (unlikely(!op->defaults_tuple)) result = -1;
30874 op->defaults_kwdict = PySequence_ITEM(res, 1);
30875 if (unlikely(!op->defaults_kwdict)) result = -1;
30882 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
30886 }
else if (value != Py_None && !PyTuple_Check(value)) {
30887 PyErr_SetString(PyExc_TypeError,
30888 "__defaults__ must be set to a tuple object");
30892 tmp = op->defaults_tuple;
30893 op->defaults_tuple = value;
30898 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
30899 PyObject* result = op->defaults_tuple;
30900 if (unlikely(!result)) {
30901 if (op->defaults_getter) {
30902 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
30903 result = op->defaults_tuple;
30912 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
30916 }
else if (value != Py_None && !PyDict_Check(value)) {
30917 PyErr_SetString(PyExc_TypeError,
30918 "__kwdefaults__ must be set to a dict object");
30922 tmp = op->defaults_kwdict;
30923 op->defaults_kwdict = value;
30928 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
30929 PyObject* result = op->defaults_kwdict;
30930 if (unlikely(!result)) {
30931 if (op->defaults_getter) {
30932 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
30933 result = op->defaults_kwdict;
30942 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
30944 if (!value || value == Py_None) {
30946 }
else if (!PyDict_Check(value)) {
30947 PyErr_SetString(PyExc_TypeError,
30948 "__annotations__ must be set to a dict object");
30952 tmp = op->func_annotations;
30953 op->func_annotations = value;
30958 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
30959 PyObject* result = op->func_annotations;
30960 if (unlikely(!result)) {
30961 result = PyDict_New();
30962 if (unlikely(!result))
return NULL;
30963 op->func_annotations = result;
30968 static PyGetSetDef __pyx_CyFunction_getsets[] = {
30969 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30970 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30971 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30972 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30973 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
30974 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
30975 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
30976 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
30977 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30978 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30979 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30980 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30981 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
30982 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
30983 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
30984 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
30985 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
30986 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
30989 static PyMemberDef __pyx_CyFunction_members[] = {
30990 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
30994 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
30996 #if PY_MAJOR_VERSION >= 3
30997 Py_INCREF(m->func_qualname);
30998 return m->func_qualname;
31000 return PyString_FromString(m->func.m_ml->ml_name);
31003 static PyMethodDef __pyx_CyFunction_methods[] = {
31004 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
31007 #if PY_VERSION_HEX < 0x030500A0
31008 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
31010 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
31012 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
31013 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31014 if (unlikely(op == NULL))
31017 __Pyx_CyFunction_weakreflist(op) = NULL;
31018 op->func.m_ml = ml;
31019 op->func.m_self = (PyObject *) op;
31020 Py_XINCREF(closure);
31021 op->func_closure = closure;
31022 Py_XINCREF(module);
31023 op->func.m_module = module;
31024 op->func_dict = NULL;
31025 op->func_name = NULL;
31026 Py_INCREF(qualname);
31027 op->func_qualname = qualname;
31028 op->func_doc = NULL;
31029 op->func_classobj = NULL;
31030 op->func_globals = globals;
31031 Py_INCREF(op->func_globals);
31033 op->func_code = code;
31034 op->defaults_pyobjects = 0;
31035 op->defaults_size = 0;
31036 op->defaults = NULL;
31037 op->defaults_tuple = NULL;
31038 op->defaults_kwdict = NULL;
31039 op->defaults_getter = NULL;
31040 op->func_annotations = NULL;
31041 return (PyObject *) op;
31044 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
31046 Py_CLEAR(m->func_closure);
31047 Py_CLEAR(m->func.m_module);
31048 Py_CLEAR(m->func_dict);
31049 Py_CLEAR(m->func_name);
31050 Py_CLEAR(m->func_qualname);
31051 Py_CLEAR(m->func_doc);
31052 Py_CLEAR(m->func_globals);
31053 Py_CLEAR(m->func_code);
31054 Py_CLEAR(m->func_classobj);
31055 Py_CLEAR(m->defaults_tuple);
31056 Py_CLEAR(m->defaults_kwdict);
31057 Py_CLEAR(m->func_annotations);
31059 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
31061 for (i = 0; i < m->defaults_pyobjects; i++)
31062 Py_XDECREF(pydefaults[i]);
31063 PyObject_Free(m->defaults);
31064 m->defaults = NULL;
31068 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
31070 if (__Pyx_CyFunction_weakreflist(m) != NULL)
31071 PyObject_ClearWeakRefs((PyObject *) m);
31072 __Pyx_CyFunction_clear(m);
31073 PyObject_GC_Del(m);
31075 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
31077 PyObject_GC_UnTrack(m);
31078 __Pyx__CyFunction_dealloc(m);
31080 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
31082 Py_VISIT(m->func_closure);
31083 Py_VISIT(m->func.m_module);
31084 Py_VISIT(m->func_dict);
31085 Py_VISIT(m->func_name);
31086 Py_VISIT(m->func_qualname);
31087 Py_VISIT(m->func_doc);
31088 Py_VISIT(m->func_globals);
31089 Py_VISIT(m->func_code);
31090 Py_VISIT(m->func_classobj);
31091 Py_VISIT(m->defaults_tuple);
31092 Py_VISIT(m->defaults_kwdict);
31094 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
31096 for (i = 0; i < m->defaults_pyobjects; i++)
31097 Py_VISIT(pydefaults[i]);
31101 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
31103 #if PY_MAJOR_VERSION < 3
31104 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31105 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
31109 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
31111 type = (PyObject *)(Py_TYPE(obj));
31112 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
31114 if (obj == Py_None)
31117 return __Pyx_PyMethod_New(func, obj, type);
31120 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
31122 #if PY_MAJOR_VERSION >= 3
31123 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
31124 op->func_qualname, (
void *)op);
31126 return PyString_FromFormat(
"<cyfunction %s at %p>",
31127 PyString_AsString(op->func_qualname), (
void *)op);
31130 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
31131 PyCFunctionObject* f = (PyCFunctionObject*)func;
31132 PyCFunction meth = f->m_ml->ml_meth;
31134 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
31136 if (likely(kw == NULL || PyDict_Size(kw) == 0))
31137 return (*meth)(
self, arg);
31139 case METH_VARARGS | METH_KEYWORDS:
31140 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
31142 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
31143 size = PyTuple_GET_SIZE(arg);
31144 if (likely(size == 0))
31145 return (*meth)(
self, NULL);
31146 PyErr_Format(PyExc_TypeError,
31147 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
31148 f->m_ml->ml_name, size);
31153 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
31154 size = PyTuple_GET_SIZE(arg);
31155 if (likely(size == 1)) {
31156 PyObject *result, *arg0;
31157 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31158 arg0 = PyTuple_GET_ITEM(arg, 0);
31160 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
31162 result = (*meth)(
self, arg0);
31163 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
31168 PyErr_Format(PyExc_TypeError,
31169 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
31170 f->m_ml->ml_name, size);
31175 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
31176 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
31177 "longer supported!");
31180 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
31184 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
31185 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
31187 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
31189 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
31190 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
31192 PyObject *new_args;
31194 argc = PyTuple_GET_SIZE(args);
31195 new_args = PyTuple_GetSlice(args, 1, argc);
31196 if (unlikely(!new_args))
31198 self = PyTuple_GetItem(args, 0);
31199 if (unlikely(!
self)) {
31200 Py_DECREF(new_args);
31201 #if PY_MAJOR_VERSION > 2
31202 PyErr_Format(PyExc_TypeError,
31203 "unbound method %.200S() needs an argument",
31204 cyfunc->func_qualname);
31206 PyErr_SetString(PyExc_TypeError,
31207 "unbound method needs an argument");
31211 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
31212 Py_DECREF(new_args);
31214 result = __Pyx_CyFunction_Call(func, args, kw);
31218 static PyTypeObject __pyx_CyFunctionType_type = {
31219 PyVarObject_HEAD_INIT(0, 0)
31220 "cython_function_or_method",
31221 sizeof(__pyx_CyFunctionObject),
31223 (destructor) __Pyx_CyFunction_dealloc,
31227 #if PY_MAJOR_VERSION < 3
31232 (reprfunc) __Pyx_CyFunction_repr,
31237 __Pyx_CyFunction_CallAsMethod,
31242 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
31244 (traverseproc) __Pyx_CyFunction_traverse,
31245 (inquiry) __Pyx_CyFunction_clear,
31247 #
if PY_VERSION_HEX < 0x030500A0
31248 offsetof(__pyx_CyFunctionObject, func_weakreflist),
31250 offsetof(PyCFunctionObject, m_weakreflist),
31254 __pyx_CyFunction_methods,
31255 __pyx_CyFunction_members,
31256 __pyx_CyFunction_getsets,
31259 __Pyx_CyFunction_descr_get,
31261 offsetof(__pyx_CyFunctionObject, func_dict),
31274 #if PY_VERSION_HEX >= 0x030400a1
31277 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
31280 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31283 #if PY_VERSION_HEX >= 0x030C0000
31286 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
31290 static int __pyx_CyFunction_init(
void) {
31291 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
31292 if (unlikely(__pyx_CyFunctionType == NULL)) {
31297 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
31298 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31299 m->defaults = PyObject_Malloc(size);
31300 if (unlikely(!m->defaults))
31301 return PyErr_NoMemory();
31302 memset(m->defaults, 0, size);
31303 m->defaults_pyobjects = pyobjects;
31304 m->defaults_size = size;
31305 return m->defaults;
31307 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
31308 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31309 m->defaults_tuple = tuple;
31312 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
31313 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31314 m->defaults_kwdict = dict;
31317 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
31318 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31319 m->func_annotations = dict;
31324 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
31325 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31326 PyObject *op = __Pyx_CyFunction_Init(
31327 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
31328 ml, flags, qualname, closure, module, globals, code
31331 PyObject_GC_Track(op);
31337 #ifndef CYTHON_CLINE_IN_TRACEBACK
31338 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
31339 PyObject *use_cline;
31340 PyObject *ptype, *pvalue, *ptraceback;
31341 #if CYTHON_COMPILING_IN_CPYTHON
31342 PyObject **cython_runtime_dict;
31344 if (unlikely(!__pyx_cython_runtime)) {
31347 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
31348 #if CYTHON_COMPILING_IN_CPYTHON
31349 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
31350 if (likely(cython_runtime_dict)) {
31351 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
31352 use_cline, *cython_runtime_dict,
31353 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
31357 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
31358 if (use_cline_obj) {
31359 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
31360 Py_DECREF(use_cline_obj);
31368 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
31370 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
31373 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
31379 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
31380 int start = 0, mid = 0, end = count - 1;
31381 if (end >= 0 && code_line > entries[end].code_line) {
31384 while (start < end) {
31385 mid = start + (end - start) / 2;
31386 if (code_line < entries[mid].code_line) {
31388 }
else if (code_line > entries[mid].code_line) {
31394 if (code_line <= entries[mid].code_line) {
31400 static PyCodeObject *__pyx_find_code_object(
int code_line) {
31401 PyCodeObject* code_object;
31403 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
31406 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
31407 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
31410 code_object = __pyx_code_cache.entries[pos].code_object;
31411 Py_INCREF(code_object);
31412 return code_object;
31414 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
31416 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
31417 if (unlikely(!code_line)) {
31420 if (unlikely(!entries)) {
31421 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
31422 if (likely(entries)) {
31423 __pyx_code_cache.entries = entries;
31424 __pyx_code_cache.max_count = 64;
31425 __pyx_code_cache.count = 1;
31426 entries[0].code_line = code_line;
31427 entries[0].code_object = code_object;
31428 Py_INCREF(code_object);
31432 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
31433 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
31434 PyCodeObject* tmp = entries[pos].code_object;
31435 entries[pos].code_object = code_object;
31439 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
31440 int new_max = __pyx_code_cache.max_count + 64;
31441 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
31442 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
31443 if (unlikely(!entries)) {
31446 __pyx_code_cache.entries = entries;
31447 __pyx_code_cache.max_count = new_max;
31449 for (i=__pyx_code_cache.count; i>pos; i--) {
31450 entries[i] = entries[i-1];
31452 entries[pos].code_line = code_line;
31453 entries[pos].code_object = code_object;
31454 __pyx_code_cache.count++;
31455 Py_INCREF(code_object);
31459 #include "compile.h"
31460 #include "frameobject.h"
31461 #include "traceback.h"
31462 #if PY_VERSION_HEX >= 0x030b00a6
31463 #ifndef Py_BUILD_CORE
31464 #define Py_BUILD_CORE 1
31466 #include "internal/pycore_frame.h"
31468 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
31469 const char *funcname,
int c_line,
31470 int py_line,
const char *filename) {
31471 PyCodeObject *py_code = NULL;
31472 PyObject *py_funcname = NULL;
31473 #if PY_MAJOR_VERSION < 3
31474 PyObject *py_srcfile = NULL;
31475 py_srcfile = PyString_FromString(filename);
31476 if (!py_srcfile)
goto bad;
31479 #if PY_MAJOR_VERSION < 3
31480 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31481 if (!py_funcname)
goto bad;
31483 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31484 if (!py_funcname)
goto bad;
31485 funcname = PyUnicode_AsUTF8(py_funcname);
31486 if (!funcname)
goto bad;
31490 #if PY_MAJOR_VERSION < 3
31491 py_funcname = PyString_FromString(funcname);
31492 if (!py_funcname)
goto bad;
31495 #if PY_MAJOR_VERSION < 3
31496 py_code = __Pyx_PyCode_New(
31513 Py_DECREF(py_srcfile);
31515 py_code = PyCode_NewEmpty(filename, funcname, py_line);
31517 Py_XDECREF(py_funcname);
31520 Py_XDECREF(py_funcname);
31521 #if PY_MAJOR_VERSION < 3
31522 Py_XDECREF(py_srcfile);
31526 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
31527 int py_line,
const char *filename) {
31528 PyCodeObject *py_code = 0;
31529 PyFrameObject *py_frame = 0;
31530 PyThreadState *tstate = __Pyx_PyThreadState_Current;
31531 PyObject *ptype, *pvalue, *ptraceback;
31533 c_line = __Pyx_CLineForTraceback(tstate, c_line);
31535 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
31537 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
31538 py_code = __Pyx_CreateCodeObjectForTraceback(
31539 funcname, c_line, py_line, filename);
31544 Py_XDECREF(pvalue);
31545 Py_XDECREF(ptraceback);
31548 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
31549 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
31551 py_frame = PyFrame_New(
31557 if (!py_frame)
goto bad;
31558 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
31559 PyTraceBack_Here(py_frame);
31561 Py_XDECREF(py_code);
31562 Py_XDECREF(py_frame);
31565 #if PY_MAJOR_VERSION < 3
31566 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
31567 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
31568 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
31569 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
31570 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
31573 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
31574 PyObject *obj = view->obj;
31576 if (PyObject_CheckBuffer(obj)) {
31577 PyBuffer_Release(view);
31589 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
31591 int i, index, step, start;
31592 Py_ssize_t itemsize = mvs.memview->view.itemsize;
31593 if (order ==
'F') {
31600 for (i = 0; i < ndim; i++) {
31601 index = start + step * i;
31602 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
31604 itemsize *= mvs.shape[index];
31611 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
31612 void **out_start,
void **out_end,
31613 int ndim,
size_t itemsize)
31617 start = end = slice->data;
31618 for (i = 0; i < ndim; i++) {
31619 Py_ssize_t stride = slice->strides[i];
31620 Py_ssize_t extent = slice->shape[i];
31622 *out_start = *out_end = start;
31626 end += stride * (extent - 1);
31628 start += stride * (extent - 1);
31631 *out_start = start;
31632 *out_end = end + itemsize;
31635 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
31636 __Pyx_memviewslice *slice2,
31637 int ndim,
size_t itemsize)
31639 void *start1, *end1, *start2, *end2;
31640 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
31641 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
31642 return (start1 < end2) && (start2 < end1);
31646 static CYTHON_INLINE PyObject *
31647 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
31650 #if PY_VERSION_HEX >= 0x02070000
31651 cobj = PyCapsule_New(p, sig, NULL);
31653 cobj = PyCObject_FromVoidPtr(p, NULL);
31659 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
31660 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
31661 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
31662 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
31663 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
31665 func_type value = func_value;\
31666 if (sizeof(target_type) < sizeof(func_type)) {\
31667 if (unlikely(value != (func_type) (target_type) value)) {\
31668 func_type zero = 0;\
31669 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
31670 return (target_type) -1;\
31671 if (is_unsigned && unlikely(value < zero))\
31672 goto raise_neg_overflow;\
31674 goto raise_overflow;\
31677 return (target_type) value;\
31681 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
31687 S.u32 = 0x01020304;
31688 return S.u8[0] == 4;
31692 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
31693 __Pyx_BufFmt_StackElem* stack,
31694 __Pyx_TypeInfo* type) {
31695 stack[0].field = &ctx->root;
31696 stack[0].parent_offset = 0;
31697 ctx->root.type = type;
31698 ctx->root.name =
"buffer dtype";
31699 ctx->root.offset = 0;
31701 ctx->head->field = &ctx->root;
31702 ctx->fmt_offset = 0;
31703 ctx->head->parent_offset = 0;
31704 ctx->new_packmode =
'@';
31705 ctx->enc_packmode =
'@';
31706 ctx->new_count = 1;
31707 ctx->enc_count = 0;
31709 ctx->is_complex = 0;
31710 ctx->is_valid_array = 0;
31711 ctx->struct_alignment = 0;
31712 while (type->typegroup ==
'S') {
31714 ctx->head->field = type->fields;
31715 ctx->head->parent_offset = 0;
31716 type = type->fields->type;
31719 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
31721 const char* t = *ts;
31722 if (*t < '0' || *t >
'9') {
31725 count = *t++ -
'0';
31726 while (*t >=
'0' && *t <=
'9') {
31728 count += *t++ -
'0';
31734 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
31735 int number = __Pyx_BufFmt_ParseNumber(ts);
31737 PyErr_Format(PyExc_ValueError,\
31738 "Does not understand character buffer dtype format string ('%c')", **ts);
31741 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
31742 PyErr_Format(PyExc_ValueError,
31743 "Unexpected format string character: '%c'", ch);
31745 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
31747 case '?':
return "'bool'";
31748 case 'c':
return "'char'";
31749 case 'b':
return "'signed char'";
31750 case 'B':
return "'unsigned char'";
31751 case 'h':
return "'short'";
31752 case 'H':
return "'unsigned short'";
31753 case 'i':
return "'int'";
31754 case 'I':
return "'unsigned int'";
31755 case 'l':
return "'long'";
31756 case 'L':
return "'unsigned long'";
31757 case 'q':
return "'long long'";
31758 case 'Q':
return "'unsigned long long'";
31759 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
31760 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
31761 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
31762 case 'T':
return "a struct";
31763 case 'O':
return "Python object";
31764 case 'P':
return "a pointer";
31765 case 's':
case 'p':
return "a string";
31766 case 0:
return "end";
31767 default:
return "unparseable format string";
31770 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
31772 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
31773 case 'h':
case 'H':
return 2;
31774 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
31775 case 'q':
case 'Q':
return 8;
31776 case 'f':
return (is_complex ? 8 : 4);
31777 case 'd':
return (is_complex ? 16 : 8);
31779 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
31782 case 'O':
case 'P':
return sizeof(
void*);
31784 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31788 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
31790 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
31791 case 'h':
case 'H':
return sizeof(short);
31792 case 'i':
case 'I':
return sizeof(int);
31793 case 'l':
case 'L':
return sizeof(long);
31794 #ifdef HAVE_LONG_LONG
31795 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
31797 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
31798 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
31799 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
31800 case 'O':
case 'P':
return sizeof(
void*);
31802 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31807 typedef struct {
char c;
short x; } __Pyx_st_short;
31808 typedef struct {
char c;
int x; } __Pyx_st_int;
31809 typedef struct {
char c;
long x; } __Pyx_st_long;
31810 typedef struct {
char c;
float x; } __Pyx_st_float;
31811 typedef struct {
char c;
double x; } __Pyx_st_double;
31812 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
31813 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
31814 #ifdef HAVE_LONG_LONG
31815 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
31817 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
31819 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
31820 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
31821 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
31822 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
31823 #ifdef HAVE_LONG_LONG
31824 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
31826 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
31827 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
31828 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
31829 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
31831 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31839 typedef struct {
short x;
char c; } __Pyx_pad_short;
31840 typedef struct {
int x;
char c; } __Pyx_pad_int;
31841 typedef struct {
long x;
char c; } __Pyx_pad_long;
31842 typedef struct {
float x;
char c; } __Pyx_pad_float;
31843 typedef struct {
double x;
char c; } __Pyx_pad_double;
31844 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
31845 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
31846 #ifdef HAVE_LONG_LONG
31847 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
31849 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
31851 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
31852 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
31853 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
31854 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
31855 #ifdef HAVE_LONG_LONG
31856 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
31858 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
31859 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
31860 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
31861 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
31863 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31867 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
31871 case 'b':
case 'h':
case 'i':
31872 case 'l':
case 'q':
case 's':
case 'p':
31874 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
31876 case 'f':
case 'd':
case 'g':
31877 return (is_complex ?
'C' :
'R');
31883 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31888 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
31889 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
31890 const char* expected;
31892 if (ctx->head == NULL) {
31896 expected = ctx->head->field->type->name;
31899 PyErr_Format(PyExc_ValueError,
31900 "Buffer dtype mismatch, expected %s%s%s but got %s",
31901 quote, expected, quote,
31902 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
31904 __Pyx_StructField* field = ctx->head->field;
31905 __Pyx_StructField* parent = (ctx->head - 1)->field;
31906 PyErr_Format(PyExc_ValueError,
31907 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
31908 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
31909 parent->type->name, field->name);
31912 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
31914 size_t size, offset, arraysize = 1;
31915 if (ctx->enc_type == 0)
return 0;
31916 if (ctx->head->field->type->arraysize[0]) {
31918 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
31919 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
31921 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
31922 PyErr_Format(PyExc_ValueError,
31923 "Expected a dimension of size %zu, got %zu",
31924 ctx->head->field->type->arraysize[0], ctx->enc_count);
31928 if (!ctx->is_valid_array) {
31929 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
31930 ctx->head->field->type->ndim, ndim);
31933 for (i = 0; i < ctx->head->field->type->ndim; i++) {
31934 arraysize *= ctx->head->field->type->arraysize[i];
31936 ctx->is_valid_array = 0;
31937 ctx->enc_count = 1;
31939 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
31941 __Pyx_StructField* field = ctx->head->field;
31942 __Pyx_TypeInfo* type = field->type;
31943 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
31944 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
31946 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
31948 if (ctx->enc_packmode ==
'@') {
31949 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
31950 size_t align_mod_offset;
31951 if (align_at == 0)
return -1;
31952 align_mod_offset = ctx->fmt_offset % align_at;
31953 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
31954 if (ctx->struct_alignment == 0)
31955 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
31958 if (type->size != size || type->typegroup != group) {
31959 if (type->typegroup ==
'C' && type->fields != NULL) {
31960 size_t parent_offset = ctx->head->parent_offset + field->offset;
31962 ctx->head->field = type->fields;
31963 ctx->head->parent_offset = parent_offset;
31966 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
31968 __Pyx_BufFmt_RaiseExpected(ctx);
31972 offset = ctx->head->parent_offset + field->offset;
31973 if (ctx->fmt_offset != offset) {
31974 PyErr_Format(PyExc_ValueError,
31975 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
31976 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
31979 ctx->fmt_offset += size;
31981 ctx->fmt_offset += (arraysize - 1) * size;
31984 if (field == &ctx->root) {
31986 if (ctx->enc_count != 0) {
31987 __Pyx_BufFmt_RaiseExpected(ctx);
31992 ctx->head->field = ++field;
31993 if (field->type == NULL) {
31995 field = ctx->head->field;
31997 }
else if (field->type->typegroup ==
'S') {
31998 size_t parent_offset = ctx->head->parent_offset + field->offset;
31999 if (field->type->fields->type == NULL)
continue;
32000 field = field->type->fields;
32002 ctx->head->field = field;
32003 ctx->head->parent_offset = parent_offset;
32009 }
while (ctx->enc_count);
32011 ctx->is_complex = 0;
32015 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
32017 const char *ts = *tsp;
32018 int i = 0, number, ndim;
32020 if (ctx->new_count != 1) {
32021 PyErr_SetString(PyExc_ValueError,
32022 "Cannot handle repeated arrays in format string");
32025 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
32026 ndim = ctx->head->field->type->ndim;
32027 while (*ts && *ts !=
')') {
32029 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
32032 number = __Pyx_BufFmt_ExpectNumber(&ts);
32033 if (number == -1)
return NULL;
32034 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
32035 return PyErr_Format(PyExc_ValueError,
32036 "Expected a dimension of size %zu, got %d",
32037 ctx->head->field->type->arraysize[i], number);
32038 if (*ts !=
',' && *ts !=
')')
32039 return PyErr_Format(PyExc_ValueError,
32040 "Expected a comma in format string, got '%c'", *ts);
32041 if (*ts ==
',') ts++;
32045 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
32046 ctx->head->field->type->ndim, i);
32048 PyErr_SetString(PyExc_ValueError,
32049 "Unexpected end of format string, expected ')'");
32052 ctx->is_valid_array = 1;
32053 ctx->new_count = 1;
32057 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
32062 if (ctx->enc_type != 0 && ctx->head == NULL) {
32063 __Pyx_BufFmt_RaiseExpected(ctx);
32066 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
32067 if (ctx->head != NULL) {
32068 __Pyx_BufFmt_RaiseExpected(ctx);
32078 if (!__Pyx_Is_Little_Endian()) {
32079 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
32082 ctx->new_packmode =
'=';
32087 if (__Pyx_Is_Little_Endian()) {
32088 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
32091 ctx->new_packmode =
'=';
32097 ctx->new_packmode = *ts++;
32101 const char* ts_after_sub;
32102 size_t i, struct_count = ctx->new_count;
32103 size_t struct_alignment = ctx->struct_alignment;
32104 ctx->new_count = 1;
32107 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
32110 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
32112 ctx->enc_count = 0;
32113 ctx->struct_alignment = 0;
32116 for (i = 0; i != struct_count; ++i) {
32117 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
32118 if (!ts_after_sub)
return NULL;
32121 if (struct_alignment) ctx->struct_alignment = struct_alignment;
32126 size_t alignment = ctx->struct_alignment;
32128 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
32130 if (alignment && ctx->fmt_offset % alignment) {
32131 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
32136 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
32137 ctx->fmt_offset += ctx->new_count;
32138 ctx->new_count = 1;
32139 ctx->enc_count = 0;
32141 ctx->enc_packmode = ctx->new_packmode;
32147 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
32148 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
32151 CYTHON_FALLTHROUGH;
32152 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
32153 case 'l':
case 'L':
case 'q':
case 'Q':
32154 case 'f':
case 'd':
case 'g':
32155 case 'O':
case 'p':
32156 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
32157 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
32158 ctx->enc_count += ctx->new_count;
32159 ctx->new_count = 1;
32164 CYTHON_FALLTHROUGH;
32166 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
32167 ctx->enc_count = ctx->new_count;
32168 ctx->enc_packmode = ctx->new_packmode;
32169 ctx->enc_type = *ts;
32170 ctx->is_complex = got_Z;
32172 ctx->new_count = 1;
32177 while(*ts !=
':') ++ts;
32181 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
32185 int number = __Pyx_BufFmt_ExpectNumber(&ts);
32186 if (number == -1)
return NULL;
32187 ctx->new_count = (size_t)number;
32195 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
32202 if (a->size != b->size || a->typegroup != b->typegroup ||
32203 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
32204 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
32205 return a->size == b->size;
32211 for (i = 0; i < a->ndim; i++)
32212 if (a->arraysize[i] != b->arraysize[i])
32215 if (a->typegroup ==
'S') {
32216 if (a->flags != b->flags)
32218 if (a->fields || b->fields) {
32219 if (!(a->fields && b->fields))
32221 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
32222 __Pyx_StructField *field_a = a->fields + i;
32223 __Pyx_StructField *field_b = b->fields + i;
32224 if (field_a->offset != field_b->offset ||
32225 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
32228 return !a->fields[i].type && !b->fields[i].type;
32236 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
32238 if (buf->shape[dim] <= 1)
32240 if (buf->strides) {
32241 if (spec & __Pyx_MEMVIEW_CONTIG) {
32242 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
32243 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
32244 PyErr_Format(PyExc_ValueError,
32245 "Buffer is not indirectly contiguous "
32246 "in dimension %d.", dim);
32249 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
32250 PyErr_SetString(PyExc_ValueError,
32251 "Buffer and memoryview are not contiguous "
32252 "in the same dimension.");
32256 if (spec & __Pyx_MEMVIEW_FOLLOW) {
32257 Py_ssize_t stride = buf->strides[dim];
32260 if (unlikely(stride < buf->itemsize)) {
32261 PyErr_SetString(PyExc_ValueError,
32262 "Buffer and memoryview are not contiguous "
32263 "in the same dimension.");
32268 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
32269 PyErr_Format(PyExc_ValueError,
32270 "C-contiguous buffer is not contiguous in "
32271 "dimension %d", dim);
32273 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
32274 PyErr_Format(PyExc_ValueError,
32275 "C-contiguous buffer is not indirect in "
32276 "dimension %d", dim);
32278 }
else if (unlikely(buf->suboffsets)) {
32279 PyErr_SetString(PyExc_ValueError,
32280 "Buffer exposes suboffsets but no strides");
32289 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
32291 if (spec & __Pyx_MEMVIEW_DIRECT) {
32292 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
32293 PyErr_Format(PyExc_ValueError,
32294 "Buffer not compatible with direct access "
32295 "in dimension %d.", dim);
32299 if (spec & __Pyx_MEMVIEW_PTR) {
32300 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
32301 PyErr_Format(PyExc_ValueError,
32302 "Buffer is not indirectly accessible "
32303 "in dimension %d.", dim);
32312 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
32315 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
32316 Py_ssize_t stride = 1;
32317 for (i = 0; i < ndim; i++) {
32318 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
32319 PyErr_SetString(PyExc_ValueError,
32320 "Buffer not fortran contiguous.");
32323 stride = stride * buf->shape[i];
32325 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
32326 Py_ssize_t stride = 1;
32327 for (i = ndim - 1; i >- 1; i--) {
32328 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
32329 PyErr_SetString(PyExc_ValueError,
32330 "Buffer not C contiguous.");
32333 stride = stride * buf->shape[i];
32340 static int __Pyx_ValidateAndInit_memviewslice(
32345 __Pyx_TypeInfo *dtype,
32346 __Pyx_BufFmt_StackElem stack[],
32347 __Pyx_memviewslice *memviewslice,
32348 PyObject *original_obj)
32350 struct __pyx_memoryview_obj *memview, *new_memview;
32351 __Pyx_RefNannyDeclarations
32353 int i, spec = 0, retval = -1;
32354 __Pyx_BufFmt_Context ctx;
32355 int from_memoryview = __pyx_memoryview_check(original_obj);
32356 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
32357 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
32358 original_obj)->typeinfo)) {
32359 memview = (
struct __pyx_memoryview_obj *) original_obj;
32360 new_memview = NULL;
32362 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
32363 original_obj, buf_flags, 0, dtype);
32364 new_memview = memview;
32365 if (unlikely(!memview))
32368 buf = &memview->view;
32369 if (unlikely(buf->ndim != ndim)) {
32370 PyErr_Format(PyExc_ValueError,
32371 "Buffer has wrong number of dimensions (expected %d, got %d)",
32376 __Pyx_BufFmt_Init(&ctx, stack, dtype);
32377 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
32379 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
32380 PyErr_Format(PyExc_ValueError,
32381 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
32382 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
32384 (buf->itemsize > 1) ?
"s" :
"",
32387 (dtype->size > 1) ?
"s" :
"");
32390 if (buf->len > 0) {
32391 for (i = 0; i < ndim; i++) {
32392 spec = axes_specs[i];
32393 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
32395 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
32398 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
32401 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
32402 new_memview != NULL) == -1)) {
32408 Py_XDECREF(new_memview);
32411 __Pyx_RefNannyFinishContext();
32416 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj,
int writable_flag) {
32417 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32418 __Pyx_BufFmt_StackElem stack[1];
32419 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32421 if (obj == Py_None) {
32422 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32425 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32426 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32427 &__Pyx_TypeInfo_float, stack,
32429 if (unlikely(retcode == -1))
32433 result.memview = NULL;
32434 result.data = NULL;
32439 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj,
int writable_flag) {
32440 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32441 __Pyx_BufFmt_StackElem stack[1];
32442 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32444 if (obj == Py_None) {
32445 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32448 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32449 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32450 &__Pyx_TypeInfo_float, stack,
32452 if (unlikely(retcode == -1))
32456 result.memview = NULL;
32457 result.data = NULL;
32462 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj,
int writable_flag) {
32463 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32464 __Pyx_BufFmt_StackElem stack[1];
32465 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32467 if (obj == Py_None) {
32468 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32471 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32472 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32473 &__Pyx_TypeInfo_double, stack,
32475 if (unlikely(retcode == -1))
32479 result.memview = NULL;
32480 result.data = NULL;
32485 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj,
int writable_flag) {
32486 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32487 __Pyx_BufFmt_StackElem stack[1];
32488 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32490 if (obj == Py_None) {
32491 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32494 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32495 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32496 &__Pyx_TypeInfo_double, stack,
32498 if (unlikely(retcode == -1))
32502 result.memview = NULL;
32503 result.data = NULL;
32508 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj,
int writable_flag) {
32509 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32510 __Pyx_BufFmt_StackElem stack[1];
32511 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32513 if (obj == Py_None) {
32514 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32517 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32518 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32519 &__Pyx_TypeInfo_long__double, stack,
32521 if (unlikely(retcode == -1))
32525 result.memview = NULL;
32526 result.data = NULL;
32531 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *obj,
int writable_flag) {
32532 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32533 __Pyx_BufFmt_StackElem stack[1];
32534 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32536 if (obj == Py_None) {
32537 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32540 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32541 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32542 &__Pyx_TypeInfo_long__double, stack,
32544 if (unlikely(retcode == -1))
32548 result.memview = NULL;
32549 result.data = NULL;
32554 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj,
int writable_flag) {
32555 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32556 __Pyx_BufFmt_StackElem stack[1];
32557 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32559 if (obj == Py_None) {
32560 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32563 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32564 PyBUF_RECORDS_RO | writable_flag, 1,
32565 &__Pyx_TypeInfo_float, stack,
32567 if (unlikely(retcode == -1))
32571 result.memview = NULL;
32572 result.data = NULL;
32577 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
32578 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32579 __Pyx_BufFmt_StackElem stack[1];
32580 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32582 if (obj == Py_None) {
32583 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32586 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32587 PyBUF_RECORDS_RO | writable_flag, 1,
32588 &__Pyx_TypeInfo_int, stack,
32590 if (unlikely(retcode == -1))
32594 result.memview = NULL;
32595 result.data = NULL;
32600 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
32601 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32602 __Pyx_BufFmt_StackElem stack[1];
32603 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32605 if (obj == Py_None) {
32606 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32609 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32610 PyBUF_RECORDS_RO | writable_flag, 1,
32611 &__Pyx_TypeInfo_double, stack,
32613 if (unlikely(retcode == -1))
32617 result.memview = NULL;
32618 result.data = NULL;
32623 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj,
int writable_flag) {
32624 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32625 __Pyx_BufFmt_StackElem stack[1];
32626 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32628 if (obj == Py_None) {
32629 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
32632 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32633 PyBUF_RECORDS_RO | writable_flag, 1,
32634 &__Pyx_TypeInfo_long__double, stack,
32636 if (unlikely(retcode == -1))
32640 result.memview = NULL;
32641 result.data = NULL;
32646 static __Pyx_memviewslice
32647 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
32648 const char *mode,
int ndim,
32649 size_t sizeof_dtype,
int contig_flag,
32650 int dtype_is_object)
32652 __Pyx_RefNannyDeclarations
32654 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
32655 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
32656 Py_buffer *buf = &from_memview->view;
32657 PyObject *shape_tuple = NULL;
32658 PyObject *temp_int = NULL;
32659 struct __pyx_array_obj *array_obj = NULL;
32660 struct __pyx_memoryview_obj *memview_obj = NULL;
32661 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
32662 for (i = 0; i < ndim; i++) {
32663 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
32664 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
32665 "indirect dimensions (axis %d)", i);
32669 shape_tuple = PyTuple_New(ndim);
32670 if (unlikely(!shape_tuple)) {
32673 __Pyx_GOTREF(shape_tuple);
32674 for(i = 0; i < ndim; i++) {
32675 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
32676 if(unlikely(!temp_int)) {
32679 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
32683 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
32684 if (unlikely(!array_obj)) {
32687 __Pyx_GOTREF(array_obj);
32688 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
32689 (PyObject *) array_obj, contig_flag,
32691 from_mvs->memview->typeinfo);
32692 if (unlikely(!memview_obj))
32694 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
32696 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
32697 dtype_is_object) < 0))
32701 __Pyx_XDECREF(new_mvs.memview);
32702 new_mvs.memview = NULL;
32703 new_mvs.data = NULL;
32705 __Pyx_XDECREF(shape_tuple);
32706 __Pyx_XDECREF(temp_int);
32707 __Pyx_XDECREF(array_obj);
32708 __Pyx_RefNannyFinishContext();
32713 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
32714 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32715 #pragma GCC diagnostic push
32716 #pragma GCC diagnostic ignored "-Wconversion"
32718 const long neg_one = (long) -1, const_zero = (
long) 0;
32719 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32720 #pragma GCC diagnostic pop
32722 const int is_unsigned = neg_one > const_zero;
32724 if (
sizeof(
long) <
sizeof(long)) {
32725 return PyInt_FromLong((
long) value);
32726 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
32727 return PyLong_FromUnsignedLong((
unsigned long) value);
32728 #ifdef HAVE_LONG_LONG
32729 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
32730 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
32734 if (
sizeof(
long) <=
sizeof(
long)) {
32735 return PyInt_FromLong((
long) value);
32736 #ifdef HAVE_LONG_LONG
32737 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
32738 return PyLong_FromLongLong((PY_LONG_LONG) value);
32743 int one = 1;
int little = (int)*(
unsigned char *)&one;
32744 unsigned char *bytes = (
unsigned char *)&value;
32745 return _PyLong_FromByteArray(bytes,
sizeof(
long),
32746 little, !is_unsigned);
32751 static CYTHON_INLINE
LongIndexType __Pyx_PyInt_As_LongIndexType(PyObject *x) {
32752 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32753 #pragma GCC diagnostic push
32754 #pragma GCC diagnostic ignored "-Wconversion"
32757 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32758 #pragma GCC diagnostic pop
32760 const int is_unsigned = neg_one > const_zero;
32761 #if PY_MAJOR_VERSION < 3
32762 if (likely(PyInt_Check(x))) {
32764 __PYX_VERIFY_RETURN_INT(
LongIndexType,
long, PyInt_AS_LONG(x))
32766 long val = PyInt_AS_LONG(x);
32767 if (is_unsigned && unlikely(val < 0)) {
32768 goto raise_neg_overflow;
32774 if (likely(PyLong_Check(x))) {
32776 #if CYTHON_USE_PYLONG_INTERNALS
32777 const digit* digits = ((PyLongObject*)x)->ob_digit;
32778 switch (Py_SIZE(x)) {
32780 case 1: __PYX_VERIFY_RETURN_INT(
LongIndexType, digit, digits[0])
32783 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32784 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32785 }
else if (8 *
sizeof(
LongIndexType) >= 2 * PyLong_SHIFT) {
32792 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32793 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32794 }
else if (8 *
sizeof(
LongIndexType) >= 3 * PyLong_SHIFT) {
32801 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32802 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32803 }
else if (8 *
sizeof(
LongIndexType) >= 4 * PyLong_SHIFT) {
32810 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
32811 if (unlikely(Py_SIZE(x) < 0)) {
32812 goto raise_neg_overflow;
32816 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32817 if (unlikely(result < 0))
32819 if (unlikely(result == 1))
32820 goto raise_neg_overflow;
32824 __PYX_VERIFY_RETURN_INT_EXC(
LongIndexType,
unsigned long, PyLong_AsUnsignedLong(x))
32825 #ifdef HAVE_LONG_LONG
32826 }
else if (
sizeof(
LongIndexType) <=
sizeof(
unsigned PY_LONG_LONG)) {
32827 __PYX_VERIFY_RETURN_INT_EXC(
LongIndexType,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32831 #if CYTHON_USE_PYLONG_INTERNALS
32832 const digit* digits = ((PyLongObject*)x)->ob_digit;
32833 switch (Py_SIZE(x)) {
32835 case -1: __PYX_VERIFY_RETURN_INT(
LongIndexType, sdigit, (sdigit) (-(sdigit)digits[0]))
32836 case 1: __PYX_VERIFY_RETURN_INT(
LongIndexType, digit, +digits[0])
32839 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32840 __PYX_VERIFY_RETURN_INT(
LongIndexType,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32841 }
else if (8 *
sizeof(
LongIndexType) - 1 > 2 * PyLong_SHIFT) {
32848 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32849 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32850 }
else if (8 *
sizeof(
LongIndexType) - 1 > 2 * PyLong_SHIFT) {
32857 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32858 __PYX_VERIFY_RETURN_INT(
LongIndexType,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32859 }
else if (8 *
sizeof(
LongIndexType) - 1 > 3 * PyLong_SHIFT) {
32866 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32867 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32868 }
else if (8 *
sizeof(
LongIndexType) - 1 > 3 * PyLong_SHIFT) {
32875 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32876 __PYX_VERIFY_RETURN_INT(
LongIndexType,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32877 }
else if (8 *
sizeof(
LongIndexType) - 1 > 4 * PyLong_SHIFT) {
32884 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32885 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32886 }
else if (8 *
sizeof(
LongIndexType) - 1 > 4 * PyLong_SHIFT) {
32894 __PYX_VERIFY_RETURN_INT_EXC(
LongIndexType,
long, PyLong_AsLong(x))
32895 #ifdef HAVE_LONG_LONG
32896 }
else if (
sizeof(
LongIndexType) <=
sizeof(PY_LONG_LONG)) {
32897 __PYX_VERIFY_RETURN_INT_EXC(
LongIndexType, PY_LONG_LONG, PyLong_AsLongLong(x))
32902 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32903 PyErr_SetString(PyExc_RuntimeError,
32904 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
32907 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
32908 #if PY_MAJOR_VERSION < 3
32909 if (likely(v) && !PyLong_Check(v)) {
32911 v = PyNumber_Long(tmp);
32916 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
32917 unsigned char *bytes = (
unsigned char *)&val;
32918 int ret = _PyLong_AsByteArray((PyLongObject *)v,
32919 bytes,
sizeof(val),
32920 is_little, !is_unsigned);
32930 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32932 val = __Pyx_PyInt_As_LongIndexType(tmp);
32937 PyErr_SetString(PyExc_OverflowError,
32938 "value too large to convert to LongIndexType");
32940 raise_neg_overflow:
32941 PyErr_SetString(PyExc_OverflowError,
32942 "can't convert negative value to LongIndexType");
32947 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
32948 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32949 #pragma GCC diagnostic push
32950 #pragma GCC diagnostic ignored "-Wconversion"
32952 const int neg_one = (int) -1, const_zero = (
int) 0;
32953 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32954 #pragma GCC diagnostic pop
32956 const int is_unsigned = neg_one > const_zero;
32957 #if PY_MAJOR_VERSION < 3
32958 if (likely(PyInt_Check(x))) {
32959 if (
sizeof(
int) <
sizeof(long)) {
32960 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
32962 long val = PyInt_AS_LONG(x);
32963 if (is_unsigned && unlikely(val < 0)) {
32964 goto raise_neg_overflow;
32970 if (likely(PyLong_Check(x))) {
32972 #if CYTHON_USE_PYLONG_INTERNALS
32973 const digit* digits = ((PyLongObject*)x)->ob_digit;
32974 switch (Py_SIZE(x)) {
32975 case 0:
return (
int) 0;
32976 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
32978 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
32979 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
32980 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32981 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
32982 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
32987 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
32988 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
32989 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32990 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
32991 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32996 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
32997 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
32998 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
32999 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
33000 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
33006 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33007 if (unlikely(Py_SIZE(x) < 0)) {
33008 goto raise_neg_overflow;
33012 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33013 if (unlikely(result < 0))
33015 if (unlikely(result == 1))
33016 goto raise_neg_overflow;
33019 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
33020 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
33021 #ifdef HAVE_LONG_LONG
33022 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
33023 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33027 #if CYTHON_USE_PYLONG_INTERNALS
33028 const digit* digits = ((PyLongObject*)x)->ob_digit;
33029 switch (Py_SIZE(x)) {
33030 case 0:
return (
int) 0;
33031 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
33032 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
33034 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
33035 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
33036 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33037 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
33038 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
33043 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
33044 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
33045 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33046 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
33047 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
33052 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
33053 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
33054 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33055 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
33056 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33061 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
33062 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
33063 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33064 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
33065 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33070 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
33071 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
33072 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33073 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
33074 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
33079 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
33080 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
33081 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33082 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
33083 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
33089 if (
sizeof(
int) <=
sizeof(long)) {
33090 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
33091 #ifdef HAVE_LONG_LONG
33092 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
33093 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
33098 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
33099 PyErr_SetString(PyExc_RuntimeError,
33100 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
33103 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
33104 #if PY_MAJOR_VERSION < 3
33105 if (likely(v) && !PyLong_Check(v)) {
33107 v = PyNumber_Long(tmp);
33112 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
33113 unsigned char *bytes = (
unsigned char *)&val;
33114 int ret = _PyLong_AsByteArray((PyLongObject *)v,
33115 bytes,
sizeof(val),
33116 is_little, !is_unsigned);
33126 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33127 if (!tmp)
return (
int) -1;
33128 val = __Pyx_PyInt_As_int(tmp);
33133 PyErr_SetString(PyExc_OverflowError,
33134 "value too large to convert to int");
33136 raise_neg_overflow:
33137 PyErr_SetString(PyExc_OverflowError,
33138 "can't convert negative value to int");
33143 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
33144 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33145 #pragma GCC diagnostic push
33146 #pragma GCC diagnostic ignored "-Wconversion"
33148 const long neg_one = (long) -1, const_zero = (
long) 0;
33149 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33150 #pragma GCC diagnostic pop
33152 const int is_unsigned = neg_one > const_zero;
33153 #if PY_MAJOR_VERSION < 3
33154 if (likely(PyInt_Check(x))) {
33155 if (
sizeof(
long) <
sizeof(long)) {
33156 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
33158 long val = PyInt_AS_LONG(x);
33159 if (is_unsigned && unlikely(val < 0)) {
33160 goto raise_neg_overflow;
33166 if (likely(PyLong_Check(x))) {
33168 #if CYTHON_USE_PYLONG_INTERNALS
33169 const digit* digits = ((PyLongObject*)x)->ob_digit;
33170 switch (Py_SIZE(x)) {
33171 case 0:
return (
long) 0;
33172 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
33174 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
33175 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
33176 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33177 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
33178 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
33183 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
33184 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
33185 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33186 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
33187 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33192 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
33193 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
33194 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33195 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
33196 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
33202 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33203 if (unlikely(Py_SIZE(x) < 0)) {
33204 goto raise_neg_overflow;
33208 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33209 if (unlikely(result < 0))
33211 if (unlikely(result == 1))
33212 goto raise_neg_overflow;
33215 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
33216 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
33217 #ifdef HAVE_LONG_LONG
33218 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
33219 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33223 #if CYTHON_USE_PYLONG_INTERNALS
33224 const digit* digits = ((PyLongObject*)x)->ob_digit;
33225 switch (Py_SIZE(x)) {
33226 case 0:
return (
long) 0;
33227 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
33228 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
33230 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
33231 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
33232 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33233 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
33234 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
33239 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
33240 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
33241 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33242 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
33243 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
33248 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
33249 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
33250 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33251 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
33252 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33257 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
33258 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
33259 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33260 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
33261 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33266 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
33267 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
33268 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33269 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
33270 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
33275 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
33276 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
33277 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33278 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
33279 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
33285 if (
sizeof(
long) <=
sizeof(long)) {
33286 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
33287 #ifdef HAVE_LONG_LONG
33288 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
33289 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
33294 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
33295 PyErr_SetString(PyExc_RuntimeError,
33296 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
33299 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
33300 #if PY_MAJOR_VERSION < 3
33301 if (likely(v) && !PyLong_Check(v)) {
33303 v = PyNumber_Long(tmp);
33308 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
33309 unsigned char *bytes = (
unsigned char *)&val;
33310 int ret = _PyLong_AsByteArray((PyLongObject *)v,
33311 bytes,
sizeof(val),
33312 is_little, !is_unsigned);
33322 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33323 if (!tmp)
return (
long) -1;
33324 val = __Pyx_PyInt_As_long(tmp);
33329 PyErr_SetString(PyExc_OverflowError,
33330 "value too large to convert to long");
33332 raise_neg_overflow:
33333 PyErr_SetString(PyExc_OverflowError,
33334 "can't convert negative value to long");
33339 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
33340 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33341 #pragma GCC diagnostic push
33342 #pragma GCC diagnostic ignored "-Wconversion"
33344 const int neg_one = (int) -1, const_zero = (
int) 0;
33345 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33346 #pragma GCC diagnostic pop
33348 const int is_unsigned = neg_one > const_zero;
33350 if (
sizeof(
int) <
sizeof(long)) {
33351 return PyInt_FromLong((
long) value);
33352 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
33353 return PyLong_FromUnsignedLong((
unsigned long) value);
33354 #ifdef HAVE_LONG_LONG
33355 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
33356 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
33360 if (
sizeof(
int) <=
sizeof(
long)) {
33361 return PyInt_FromLong((
long) value);
33362 #ifdef HAVE_LONG_LONG
33363 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
33364 return PyLong_FromLongLong((PY_LONG_LONG) value);
33369 int one = 1;
int little = (int)*(
unsigned char *)&one;
33370 unsigned char *bytes = (
unsigned char *)&value;
33371 return _PyLong_FromByteArray(bytes,
sizeof(
int),
33372 little, !is_unsigned);
33377 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
33378 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33379 #pragma GCC diagnostic push
33380 #pragma GCC diagnostic ignored "-Wconversion"
33382 const char neg_one = (char) -1, const_zero = (
char) 0;
33383 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33384 #pragma GCC diagnostic pop
33386 const int is_unsigned = neg_one > const_zero;
33387 #if PY_MAJOR_VERSION < 3
33388 if (likely(PyInt_Check(x))) {
33389 if (
sizeof(
char) <
sizeof(long)) {
33390 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
33392 long val = PyInt_AS_LONG(x);
33393 if (is_unsigned && unlikely(val < 0)) {
33394 goto raise_neg_overflow;
33400 if (likely(PyLong_Check(x))) {
33402 #if CYTHON_USE_PYLONG_INTERNALS
33403 const digit* digits = ((PyLongObject*)x)->ob_digit;
33404 switch (Py_SIZE(x)) {
33405 case 0:
return (
char) 0;
33406 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
33408 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
33409 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
33410 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33411 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
33412 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
33417 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
33418 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
33419 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33420 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
33421 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33426 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
33427 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
33428 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33429 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
33430 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
33436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33437 if (unlikely(Py_SIZE(x) < 0)) {
33438 goto raise_neg_overflow;
33442 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33443 if (unlikely(result < 0))
33445 if (unlikely(result == 1))
33446 goto raise_neg_overflow;
33449 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
33450 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
33451 #ifdef HAVE_LONG_LONG
33452 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
33453 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33457 #if CYTHON_USE_PYLONG_INTERNALS
33458 const digit* digits = ((PyLongObject*)x)->ob_digit;
33459 switch (Py_SIZE(x)) {
33460 case 0:
return (
char) 0;
33461 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
33462 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
33464 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
33465 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
33466 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33467 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
33468 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
33473 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
33474 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
33475 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33476 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
33477 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
33482 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
33483 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
33484 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33485 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
33486 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33491 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
33492 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
33493 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33494 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
33495 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33500 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
33501 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
33502 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33503 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
33504 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
33509 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
33510 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
33511 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
33512 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
33513 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
33519 if (
sizeof(
char) <=
sizeof(long)) {
33520 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
33521 #ifdef HAVE_LONG_LONG
33522 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
33523 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
33528 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
33529 PyErr_SetString(PyExc_RuntimeError,
33530 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
33533 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
33534 #if PY_MAJOR_VERSION < 3
33535 if (likely(v) && !PyLong_Check(v)) {
33537 v = PyNumber_Long(tmp);
33542 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
33543 unsigned char *bytes = (
unsigned char *)&val;
33544 int ret = _PyLong_AsByteArray((PyLongObject *)v,
33545 bytes,
sizeof(val),
33546 is_little, !is_unsigned);
33556 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33557 if (!tmp)
return (
char) -1;
33558 val = __Pyx_PyInt_As_char(tmp);
33563 PyErr_SetString(PyExc_OverflowError,
33564 "value too large to convert to char");
33566 raise_neg_overflow:
33567 PyErr_SetString(PyExc_OverflowError,
33568 "can't convert negative value to char");
33573 static int __Pyx_check_binary_version(
void) {
33575 int same=1, i, found_dot;
33576 const char* rt_from_call = Py_GetVersion();
33577 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
33579 for (i = 0; i < 4; i++) {
33580 if (!ctversion[i]) {
33581 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
33584 if (rt_from_call[i] != ctversion[i]) {
33590 char rtversion[5] = {
'\0'};
33592 for (i=0; i<4; ++i) {
33593 if (rt_from_call[i] ==
'.') {
33594 if (found_dot)
break;
33596 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
33599 rtversion[i] = rt_from_call[i];
33601 PyOS_snprintf(message,
sizeof(message),
33602 "compiletime version %s of module '%.100s' "
33603 "does not match runtime version %s",
33604 ctversion, __Pyx_MODULE_NAME, rtversion);
33605 return PyErr_WarnEx(NULL, message, 1);
33611 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
33613 #if PY_MAJOR_VERSION < 3
33614 if (t->is_unicode) {
33615 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
33616 }
else if (t->intern) {
33617 *t->p = PyString_InternFromString(t->s);
33619 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
33622 if (t->is_unicode | t->is_str) {
33624 *t->p = PyUnicode_InternFromString(t->s);
33625 }
else if (t->encoding) {
33626 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
33628 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
33631 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
33636 if (PyObject_Hash(*t->p) == -1)
33643 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
33644 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
33646 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
33648 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
33650 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
33651 #if !CYTHON_PEP393_ENABLED
33652 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33654 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
33655 if (!defenc)
return NULL;
33656 defenc_c = PyBytes_AS_STRING(defenc);
33657 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33659 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
33661 for (c = defenc_c; c < end; c++) {
33662 if ((
unsigned char) (*c) >= 128) {
33663 PyUnicode_AsASCIIString(o);
33669 *length = PyBytes_GET_SIZE(defenc);
33673 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33674 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
33675 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33676 if (likely(PyUnicode_IS_ASCII(o))) {
33677 *length = PyUnicode_GET_LENGTH(o);
33678 return PyUnicode_AsUTF8(o);
33680 PyUnicode_AsASCIIString(o);
33684 return PyUnicode_AsUTF8AndSize(o, length);
33689 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33690 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
33692 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33693 __Pyx_sys_getdefaultencoding_not_ascii &&
33695 PyUnicode_Check(o)) {
33696 return __Pyx_PyUnicode_AsStringAndSize(o, length);
33699 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
33700 if (PyByteArray_Check(o)) {
33701 *length = PyByteArray_GET_SIZE(o);
33702 return PyByteArray_AS_STRING(o);
33707 int r = PyBytes_AsStringAndSize(o, &result, length);
33708 if (unlikely(r < 0)) {
33715 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
33716 int is_true = x == Py_True;
33717 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
33718 else return PyObject_IsTrue(x);
33720 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
33722 if (unlikely(!x))
return -1;
33723 retval = __Pyx_PyObject_IsTrue(x);
33727 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
33728 #if PY_MAJOR_VERSION >= 3
33729 if (PyLong_Check(result)) {
33730 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
33731 "__int__ returned non-int (type %.200s). "
33732 "The ability to return an instance of a strict subclass of int "
33733 "is deprecated, and may be removed in a future version of Python.",
33734 Py_TYPE(result)->tp_name)) {
33741 PyErr_Format(PyExc_TypeError,
33742 "__%.4s__ returned non-%.4s (type %.200s)",
33743 type_name, type_name, Py_TYPE(result)->tp_name);
33747 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
33748 #if CYTHON_USE_TYPE_SLOTS
33749 PyNumberMethods *m;
33751 const char *name = NULL;
33752 PyObject *res = NULL;
33753 #if PY_MAJOR_VERSION < 3
33754 if (likely(PyInt_Check(x) || PyLong_Check(x)))
33756 if (likely(PyLong_Check(x)))
33758 return __Pyx_NewRef(x);
33759 #if CYTHON_USE_TYPE_SLOTS
33760 m = Py_TYPE(x)->tp_as_number;
33761 #if PY_MAJOR_VERSION < 3
33762 if (m && m->nb_int) {
33764 res = m->nb_int(x);
33766 else if (m && m->nb_long) {
33768 res = m->nb_long(x);
33771 if (likely(m && m->nb_int)) {
33773 res = m->nb_int(x);
33777 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
33778 res = PyNumber_Int(x);
33782 #if PY_MAJOR_VERSION < 3
33783 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
33785 if (unlikely(!PyLong_CheckExact(res))) {
33787 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
33790 else if (!PyErr_Occurred()) {
33791 PyErr_SetString(PyExc_TypeError,
33792 "an integer is required");
33796 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
33799 #if PY_MAJOR_VERSION < 3
33800 if (likely(PyInt_CheckExact(b))) {
33801 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
33802 return PyInt_AS_LONG(b);
33804 return PyInt_AsSsize_t(b);
33807 if (likely(PyLong_CheckExact(b))) {
33808 #if CYTHON_USE_PYLONG_INTERNALS
33809 const digit* digits = ((PyLongObject*)b)->ob_digit;
33810 const Py_ssize_t size = Py_SIZE(b);
33811 if (likely(__Pyx_sst_abs(size) <= 1)) {
33812 ival = likely(size) ? digits[0] : 0;
33813 if (size == -1) ival = -ival;
33818 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
33819 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
33823 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
33824 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33828 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
33829 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33833 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
33834 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
33838 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
33839 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
33843 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
33844 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33850 return PyLong_AsSsize_t(b);
33852 x = PyNumber_Index(b);
33854 ival = PyInt_AsSsize_t(x);
33858 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
33859 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
33860 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
33861 #if PY_MAJOR_VERSION < 3
33862 }
else if (likely(PyInt_CheckExact(o))) {
33863 return PyInt_AS_LONG(o);
33868 x = PyNumber_Index(o);
33870 ival = PyInt_AsLong(x);
33875 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
33876 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
33878 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
33879 return PyInt_FromSize_t(ival);
Base class for linear operators. This class serves as interface for all derived classes.